Navigating with Terminal
Advanced, Article, Mac OS X, Terminal | April 16th, 2008
One of the important things to know about Terminal is how to navigate your way around the Mac file system using Terminal. If you don’t know how to do this, you won’t get very far. This tutorial is going to give you a few key Terminal commands to help you navigate your way around.
Warning: Using Terminal can be very dangerous and is for advanced users only. Be very, very careful with what you do in Terminal as you can cripple your Operating System.
The cd (change directory) command is your best friend. With the cd command you can navigate to any part of the Mac file system (as long as you have permissions to do so). This command is used by typing cd path/to/directory For example, to navigate to my Documents folder I would launch Terminal and type cd Documents/ 
The pwd (print working directory) command is also very useful. This command will tell you the exact path to the current directory you are in. As you can see in the image below, after typing pwd and hitting enter, my current directory is displayed as a path. 
A quick way to navigate backwards one directories is to use cd ../. For example, if my current directory is Documents and I want to navigate up once to my user folder I would enter cd ../ 
The ls (list) command will show you the files in the directory you specify. For example, if I want to view the files in the directory I am currently in, I would type ls 
If you want to view all your files (including hidden files), their permissions, owner, group, size, and date you would enter ls -al 
Here’s an extremely useful tip to use for many commands in Terminal. You can issue any command from any location so long as you know the directory to the file(s)/directories you want to issue the command on. For example, if I wanted to use the ls command on my Documents directory, but I’m no where near it. Rather than using cd to navigate to it and then ls to view my files, I could just enter ls ~/Documents The ~ is a shortcut command to navigate to your Home directory (rather than typing /Volumes/Macintosh\ HD/Users/username).
Terminal has so many different commands and command options that you will never memorize them all, but these few ones you will use all the time when navigating around terminal. Happy navigating!
![Validate my RSS feed [Valid RSS]](http://www.anythingapple.net/wp-content/themes/anythingapple/images/valid-rss.png)
CHarlie
June 16th, 2008 at 6:24 amhow do you navigate to a directory with two word in the name?
e.g. cd ~/documents/logistical Cache
is this right or what?
admin
July 1st, 2008 at 9:33 pmHi Charlie, sorry for the delayed response. I have been away. Put a backslash in between the words. In your example…
~/documents/logistical\ Cache
Hope this helps!