What’s an ‘alias’ and how do i create one?

An alias is a pseudonym or shorthand for a command or series of commands.  There are at least two ways to create an alias in Unix.  If you’d just like an alias to exist for the duration of your session, in a shell type: ‘alias p pine’.  That will create an alias ‘p’ for the mail program pine. Everytime during your current session, when you press ‘p’ followed by enter in a shell, pine will be executed.  Keep in mind that once you logout, you will lose this alias.

If you’d like your alias to be there evertime you used a CADE machine, what you have to do is open up your .tcshrc in you favorite text editor (ie, vim .tcshrc) and add your alias at the bottom of the file. For example, to add an alias ‘p’ for pine, add this line:

alias p “pine”

Note that the quotes around pine are not necessary but it allows you to read the aliases in your .tcshrc easily.  Also, when using this method, the alias will not become active untill you open up a new shell or run ‘source .tcshrc’.

Posted in: Unix