Reason for aliases: to make new commands.
alias
-show aliases already set.
alias dir ls -l
-dir is now the alias for the command ls with the option of -l.
alias type cat
-
Never make
DOS aliases for UNIX commands! Also, use the
alias feature sparingly: it doesn't help you learn the UNIX commands and you may unintentionally overwrite
an existing UNIX command!
To remove an alias:
unalias type
-removes 'type' alias for cat command.
A bit more useful is creating aliases for more complicated commands:
alias howmany 'who | wc -l'
Upon logout, aliases are lost. However, they can be defined within .cshrc (Don't set them within .login because some other shells don't support aliases.)
diff
diff
-to find the differences in 2 or more files.
diff first second
-shows differences
and gives the
ed commands to make 1st file look like 2nd. (Ex: 5a 10,11 means "at line 5
append lines 10 and 11.")
uniq
-shows file with no repetative lines.