[Next] [Up] [Previous] [Contents]
Next: First Steps into Up: Basic UNIX Concepts Previous: The current working

Referring to home directories

Under both Tcsh and Bash on Linux, your home directory can be referred to using the tilde character (``~''). For example, the command

/home/larry#more ~/papers/history-final
is equivalent to
/home/larry#more /home/larry/papers/history-final
The ``~'' character is simply replaced with the name of your home directory by the shell.

In addition, you can specify other user's home directories with the tilde as well. The pathname ``~karl/letters'' translates to ``/home/karl/letters'' by the shell (if /home/karl is karl's home directory). The use of the tilde is simply a shortcut; there is no directory named ``~''-it's just syntactic sugar provided by the shell.


mdw@sunsite.unc.edu