The commands described below need to be entered while logged in to the Unix server. Normally you'll see a prompt ending with $ when the command interpreter (or shell) is ready for another command.
Use the alias command.
For example, if you put the following line in your .bashrc file:
alias lt='ls -lt|head'
then next time you log in, the command
lt
will list the 10 most recently changed files: The command ls -lt lists files in long format; the | symbol causes the output from ls -lt to be piped into the head command, which itself shows (by default) the first 10 lines of the data received.
Please suggest an improvement
(login needed, link opens in new window)
Your views are welcome and will help other readers of this page.