The C shell, ksh and bash
have a shortcut for the pathname to your home
~), often called "twiddle" by UNIX-heads.
You can use
~ in a pathname to the home directory
from wherever you are.
For example, from any directory, you can list your home directory or edit
your .cshrc file in it by typing:
ls ~... %
You could change your current directory to your home directory by
cd ~ or
cd $HOME although all shells have a
cd with no argument also takes you home.
If your shell understands the tilde, it should also have an abbreviation for other users' home directories: a tilde with the username on the end. For example, the home directory for mandi, which might really be /usr3/users/mfg/mandi, could be abbreviated ~mandi. On your account, if Mandi told you to copy the file named menu.c from her src directory, you could type:
cp ~mandi/src/menu.c .
The Bourne shell doesn't have anything like ~mandi. Here's a trick that's probably too ugly to type a lot - but it's useful in Bourne shell scripts, where you don't want to "hardcode" users' home directory pathnames. This command calls the C shell to put mandi's home directory pathname into $dir:
username=mandi dir=`csh -fc "echo ~$username"`
The tilde is a good thing to use in your, too.