Thursday, 20th November 2008
Aliases are commands that you make yourself, made up of other simpler commands. Although it's hard to describe, an example should make things clear.
'ls' on its own just lists files. It doesn't list the permissions on the file, and its output format is not terribly easy to read. I much prefer the output of 'ls -l'. So, in my .bashrc there is a line:
alias ls='ls -l'
So whenever I type 'ls' at the shell, bash understands it to mean 'ls -l' and executes that.
Another handy alias in my .bashrc is this:
alias listscp='ps aux | grep scp'
This searches through all the processes on the machine for 'scp' [a utility to transfer files]. Although there is no command listscp, if I type that at the shell, bash understands it to mean what is in the quotes above, and executes that. Now lets see how to change and add to your PATH.