UNIX Primer

Home | Primer Home


Other Useful Commands

Here are a few more commands that you may want to know. Play with them at your leisure. Especially useful is 'alias', which allows you to create customized 'commands.' For instance, we recommend that you do the following: alias rm="rm -i" --- this way, every time you type the 'rm' command, it automatically replaces it with 'rm -i' which interactively confirms whether or not you want to delete the file(s) you specified. Note that the alias command works differently under different shells.

The 'touch' command described below is used to update the timestamp on a file. It is also useful for creating 'placeholder' files. If you 'touch' a file that does not exist, it creates a file with the given name of size zero. This type of file is often used for reminders or notes about particular directories.

Finally, 'talk' allows you to interactively talk with someone else logged in to the same machine as you. Use 'who' to see who is currently logged on. In order to receive 'talk' requests, you should activate messaging first by typing 'mesg y'.

Related Commands:

NamePurpose
alias Create an alias command.
Syntax
alias <alias>=<command>

NamePurpose
unalias Delete an alias command.
Syntax
unalias <alias>

NamePurpose
touch Update the timestamp on a file to current time.
Syntax
touch <filename>
Notes
  • If file does not exist, will be created with size 0.

NamePurpose
talk Talk to another user.
Syntax
talk <username>
Notes
  • You should activate messaging first using 'mesg y'


Designed by D. Kaminsky
Edited by Diana Palsetia
© University of Pennsylvania, 2008