Next: Pipes and Redirects (|
Up: USING UNIX
Previous: Repeating and Changing Commands
You can make your own names for commands
or combinations of commands using alias. The usual way
to use it is in the form
alias name 'commands'.
For example, if you want to be asked if you really want to delete
a file you can use:
alias del 'rm -i'
After doing this, every time you type del file,
it is the same as rm -i file. When you set an alias by
typing it at a prompt it is only valid for that session and that
window. If you want to have the alias available every time
you can put the alias in your .cshrc file as described below.
To remove an alias you use unalias name. If you have
changed a command name into an alias you can use its original
form by preceding it with a backslash. Thus, if you have set
alias rm 'rm -i', you can still use the built-in
remove by using \rm
If you type just alias, you get a list of all the current aliases.
Because there are standard aliases included in your .cshrc
file you will find that you have aliases even if you never created them.