Datasheet
Book VIII
Chapter 1
. . . And UNIX Lurks 
Beneath
679
Uncovering the Terminal
The complementary cd command (lowercase) — which incidentally stands 
for change directory — opens any folder that you specify. It works much the 
same as double-clicking a folder in the Finder: The difference is that follow-
ing the cd command, you don’t immediately see all the folder’s content. 
However, the cd command requires a parameter (extra options or informa-
tion that appear after the command) so that your Mac knows which folder 
to open.
For example, to open the Documents folder that resides in your Home direc-
tory, type cd Documents and press Return. When you do, you might be 
surprised to see another prompt displayed immediately. So where are all the 
files in the Documents folder? You must enter another command to see what 
items are in the folder that you just opened. Type ls again to see the con-
tents of the Documents folder.
If you try to open a folder that has a space in its name, make sure to enclose 
the folder’s name in quotation marks, like this:
cd “My Picture Folder”
Read more about using quotation marks in your commands in the upcoming 
section “Command-line gotchas.” You can also precede a space in a name 
with a backslash, like this:
cd My\ Picture\ Folder
To return to your Home folder in this example, enter a modified version of 
the cd command:
cd ..
This causes your Mac to move back up the folder hierarchy one folder to 
your Home directory. By using these three simple commands — ls, cd 
foldername, and cd .. — you can traverse your entire hard drive.
After you successfully enter a command, you can recall it by pressing the 
up-arrow key. Press the up-arrow key again to see the command prior to 
that, and so forth. This is an extremely useful trick for retyping extra long 
file paths.
Using the skills you already have
Just because the Terminal is text based doesn’t mean that it doesn’t act 
like a good Macintosh citizen. All the usual Mac features that you know and 
love are there for you to use. Copy and Paste functions work as you might 
expect — but only at the prompt position.
55_9781118022061-bk08ch01.indd 67955_9781118022061-bk08ch01.indd 679 8/10/11 9:39 AM8/10/11 9:39 AM










