Skip to main content

Questions tagged [alias]

An alias is essentially nothing more than a keyboard shortcut, an abbreviation, a means of avoiding typing a long command sequence. This can save a great deal of typing at the command-line and avoid having to remember complex combinations of commands and options.

442 votes
16 answers
90k views

Noone should need 10 years for asking this question, like I did. If I were just starting out with Linux, I'd want to know: When to alias, when to script and when to write a function? Where aliases are ...
ixtmixilix's user avatar
  • 13.6k
145 votes
6 answers
180k views

For bash script, I can use "$@" to access arguments. What's the equivalent when I use an alias?
prosseek's user avatar
  • 8,838
134 votes
36 answers
76k views

I would like to frequently switch between directories that are in totally unrelated paths, for example /Project/Warnest/docs/ and ~/Dropbox/Projects/ds/test/. But I don't want to type cd /[full-path]/...
saiy2k's user avatar
  • 1,603
355 votes
5 answers
305k views

In my ~/.bashrc file reside two definitions: commandA, which is an alias to a longer path commandB, which is an alias to a Bash script I want to process the same file with these two commands, so I ...
Zaid's user avatar
  • 11k
108 votes
7 answers
40k views

Like most users, I have a bunch of aliases set up to give a default set of flags for frequently used programs. For instance, alias vim='vim -X' alias grep='grep -E' alias ls='ls -G' The problem is ...
Adrian Petrescu's user avatar
326 votes
25 answers
284k views

I'd like to be able to tail the output of a server log file that has messages like: INFO SEVERE etc, and if it's SEVERE, show the line in red; if it's INFO, in green. What kind of alias can I setup ...
Amir Afghani's user avatar
  • 7,373
225 votes
9 answers
58k views

Let's say I have the following alias in bash - alias ls='ls --color=auto' - and I want to call ordinary ls without options. Is the only way to do that is to unalias, do the command and then alias ...
Mirzhan Irkegulov's user avatar
64 votes
6 answers
49k views

I'm trying to set an alias for sudo !! in Bash. I tried alias sbb='sudo !!', but it interprets that as a literal !! and prints sudo: !!: command not found If I use double quotes, it substitutes the ...
Manishearth's user avatar
  • 1,007
36 votes
4 answers
20k views

I am running Ubuntu 10.04 and I use upstart for daemon management. My enterprise application is run as a daemon and must be run as root because of various privileges. E.g.: sudo start my-...
amphibient's user avatar
  • 12.8k
142 votes
10 answers
66k views

I am looking to get tab-completion on my command line aliases, for example, say I defined the following alias : alias apt-inst='sudo aptitude install' Is there a way to get the completions provided ...
levesque's user avatar
  • 3,945
44 votes
1 answer
13k views

This site says, "Shell functions are faster [than aliases]. Aliases are looked up after functions and thus resolving is slower. While aliases are easier to understand, shell functions are preferred ...
Wolf's user avatar
  • 3,095
3 votes
3 answers
1k views

I use ps -ef | grep catalina | grep -v grep to print the tomcat process running on the system: kshitiz 7099 1 0 May11 ? 00:02:29 /usr/lib/jvm/jdk1.8.0/bin/java -agentlib:jdwp=transport=...
Kshitiz Sharma's user avatar
31 votes
9 answers
26k views

Suppose you have an alias go, but want it to do different things in different directories? In one directory it should run cmd1, but in another directory it should run cmd2 By the way, I have an ...
B Seven's user avatar
  • 8,559
30 votes
3 answers
34k views

Following on from this question about stripping newlines out of text, I want to turn this into a zsh alias as follows: alias striplines=' awk " /^$/ {print \"\n\"; } /./ {printf( \" %s \",$0);}"' I'...
Seamus's user avatar
  • 3,793
11 votes
3 answers
9k views

I know that contents of double quotes are expanded, whereas the contents of single quotes are not, such that echo '$1' gives $1 where as echo "$1" gives <the argument - blank in this ...
Greenonline's user avatar
  • 2,003

15 30 50 per page
1
2 3 4 5
11