You want to create aliases to commands that you use frequently.
Edit the file ~/.bashrc using nano (Recipe 3.6), and then move to the end of the file and add as many lines as you want, like this:
alias l=’ls -a’ |
This creates an alias called l that, when entered, will be interpreted as the command ls -a.
Save and exit the file using Ctrl-X and Y, and then to update the Terminal with the new alias, type the following command:
$ source .bashrc |
Discussion
Many Linux users set up an alias for rm like the following, so that it confirms deletions.
$ alias rm=’rm -i’ |
This is not a bad idea, as long as you do not forget when you use someone else’s system that doesn’t have this alias set up!
See Also
For more information about rm, see Recipe 3.10.