Unix Reference

The working directory and pwd

Video

Whenever you are running programs, you will have a "working directory" that represents where your program starts looking for files. This is often the directory where you launch the application from, which is not necessarily the directory where the program itself resides. To determine the directory where you are currently located, use the pwd command, as follows (do not type the $ character -- that represents the end of your prompt. You simply type pwd)

$ pwd /afs/.ir/users/c/g/cgregg $

If you change to another directory, you will have a new working directory:

$ pwd /afs/.ir/users/c/g/cgregg $ cd 107 $ pwd /afs/.ir/users/c/g/cgregg/107 $

If you run a program and it cannot find your files, the first thing to check is the working directory.

Back to contents