alias symbol command , e.g.
malama% alias dir ls -asF
This alias sets the word ``dir'' to be the command ls -asF. You can alias a command to itself, which has the advantage that you keep using generic UNIX command names. The disadvantage is also precisely that: you may become accustomed to a non-standard behaviour of a command which can get you in real troubles in case you happen to be working on some other unix host. In addition scripts may show unexpected behaviour becuase they were written for the generic command. Hence, instead of aliasing rm, mv, and cp to there `-i' equivalents, you may want to call those versions e.g. del, move, and copy.
You can also create aliases that perform several commands in succession by using the command-separation symbol ``;''. If your alias is set to more than one command put the commands inside single quotes, e.g.:
malama% alias cd
'
cd
!*; pwd'
This alias will set your default to whatever you specify when
you use cd, and then print the name of the new directory. Note
the ``
'' in front of the ``cd'' in the definition; this is
to prevent retranslation of the cd alias while the command is
actually executing, since you want the real function of the cd command there. You can use this directly, should you wish to get
the normal behavior of a command instead of the way you have aliased
it.
Typing alias by itself, or with just an alias name and no value, will display the meaning of either all your aliases, or just the one you specified.
A similar function is available in the Korn shell, but is defined completely differently. In your .profile file, the definition of the alias dir shown above would look like:
dir() { ls -asF $* ;}