cd

The cd command is used to change working directories. You simply type cd followed the path name to change to. Here's some examples:

   darkstar:~$ cd /bin
   darkstar:/bin$ cd usr
   bash: cd: usr: No such file or directory
   darkstar:/bin$ cd /usr
   darkstar:/usr$
   

Notice that without the preceding slash, it tries to change to a directory in the current directory.

The cd command is not like the other commands. It is a builtin shell command. Shell builtins are discussed in the section called Environment Variables in Chapter 8. This may not make any sense to you right now. Basically it means there is no man page for this command. Instead, you have to use the shell help. Like this:

   $ help cd
   

It will display the options for cd and how to use them.