Moving About

To move about the hierarchy and know where you are, there are two commands you need to know: cd and pwd.

The simplest, pwd, tells you the name of your current directory. It takes no arguments.

You can use cd in three ways. First, just entering cd with no arguments will move you to your home directory. You can, of course, check the results by entering pwd.

If you know the location of a directory relative to the root, you can follow cd with the full pathname of the desired directory. For example, many of the programs you will use from the command line are located in the directory /usr/bin. Entering cd /usr/bin will change /usr/bin to your current directory. Similarly, entering cd /var/spool will make the system spool directory your current directory.

Was this article helpful?

0 0

Post a comment