next up previous contents
Next: Changing Directories (cd) Up: ``Elementary'' Commands Previous: ``Elementary'' Commands

Where are we? (pwd)

 

With all the various UNICES, we have the concept that our current (active) directory consists of just a single directory. It is handy to know which directory that is. The pwd (print working directory) command is used for this. If you have just logged in under the user ID (UID) of Igor, pwd will typically respond:

 % pwd
 /home/Igor
This directory is also associated with a couple of symbolic equivalences. The shell variable $HOME is usually set to your home directory (sort of obvious, eh?), and with newer shells the tilde symbol also represents your home directory.
 % echo $HOME
 /home/Igor

 % ls -a ~/
 .login
Don't worry if you don't understand the echo and ls commands, they are coming. The point I was making is that when we first login, we are in our home directory, and that this directory can be represented in a couple of ways.

It is possible with almost all of the command shells used under the various UNICES, to have this active directory actually incorporated into the shell prompt.


next up previous contents
Next: Changing Directories (cd) Up: ``Elementary'' Commands Previous: ``Elementary'' Commands

Gordon Haverland
Sat Oct 9 13:50:48 MDT 1999