next up previous contents
Next: Looking at the Up: First Steps into Previous: First Steps into

Moving around

Now that we can login, and know how to refer to files using pathnames, how can we change our current working directory, to make life easier?

    The command for moving around in the directory structure is cd, short for ``change directory''. You'll notice that many often-used Unix commands are two or three letters. The usage of the cd command is:

where directory is the name of the directory which you wish to change to.

As we said, when you login, you begin in your home directory. If Larry wanted to move down into the papers subdirectory, he'd use the command

As you can see, Larry's prompt changes to reflect his current working directory (so he knows where he is). Now that he's in the papers directory, he can look at his history final with the command

      Now, Larry is stuck in the papers subdirectory. To move back up to the parent directory, use the command

(Note the space between the `` cd'' and the `` ..''.) Every directory has an entry named `` ..'' which refers to the parent directory. Similarly, every directory has an entry named `` .'' which refers to itself. Therefore, the command

gets us nowhere.

You can also use absolute pathnames in the cd command. To cd into Karl's home directory, we can use the command

Also, using cd with no argument will return you to your own home directory.

 



Ross Biro
Tue May 23 13:39:28 PDT 1995