To change to a new directory, type cd (change directory) and the pathname of the directory you want to change to, then press <Enter>:
$You tell cd which directory to change to by giving it an argument. You can use either a relative or an absolute (starting with ``/'') pathname as an argument to cd.
If you type cd with no arguments, you go to your home directory:
$You can also change to your home directory by saying cd $HOME:
$Try moving around some directories now:
/usr/spool/lp/requests: Permission denied. (/usr/spool/lp/requests is a directory the computer uses to store printer requests temporarily.)
cd default; pwd/etc/default $
cd /usr/spool/lp/requests/usr/spool/lp/requests: Permission denied $
Q: Why do I have to press <Enter> after every command?
The carriage return you type at the end of a command line
tells the computer to process the command.
Q: What does the ``;'' do between two commands?
A: The semicolon (;) is a command separator. It tells the computer that the next word is the start of a separate command, instead of an argument for the previous command.
$This says ``change directory, print working directory.''
$This says ``change to the directory named pwd.''
Semicolons allow you to put more than one command on a line before you press <Enter> to have all the commands processed.
What does the message
Permission denied mean?
The UNIX system uses file and directory
to control who can look at, and who can change, files.
These permissions are discussed in
``Protecting files and directories''.
When you see the message
Permission denied it means the
permissions on a directory are set so you cannot go into the
This is frequently the case for system directories, such
as /usr/spool/lp/requests, and for other people's home directories.
Q: What happens if I misspell a directory name?
A: If you misspell a directory name, the computer may attempt to guess what you meant. Type y to accept its guess and change to the directory, or n to return to the prompt:
cd /etvcd /etc?