February 2004
Beginner
200 pages
5h 40m
English
The built-in command alias defines a convenient shorthand for a longer command, to save typing. For example:
$ alias ll='ls -l'
defines a new command ll that runs ls -l:
$ ll total 436 -rw-r--r-- 1 smith 3584 Oct 11 14:59 file1 -rwxr-xr-x 1 smith 72 Aug 6 23:04 file2 ...
Define aliases in your ~/.bashrc file (see Tailoring Shell Behavior) to be available whenever you log in. To see all your aliases, type alias. If aliases don’t seem powerful enough for you (since they have no parameters or branching), see Programming with Shell Scripts, run info bash, and read up on “shell functions.”