Baby Steps in Data Journalism

Starting from zero, this Tumblr provides tools, links and how-to information for people just beginning to explore data journalism.
Recent Tweets @macloo

Baby Steps in Unix/Linux Part 2: Change Directories

One of the common tasks you’ll be doing in Terminal is changing directories. What Unix calls “directories” are the same as what most of us call “folders” on our computers.

Experiment with the cd (“change directory”) command to find out how it works.

Use the ls (“list”) command to see the names of directories that are inside the current one. You will probably see one named Desktop, so let’s peek inside that one. Type the following and then press Return (or Enter):

cd Desktop

Remember that Unix is case sensitive, so pay attention to that uppercase letter “D” in Desktop.

To see what’s inside Desktop (“list” the contents), type the following and then press Return (or Enter):

ls

You should see the names of all the stuff that’s on your Mac Desktop.

To go back “up” to the parent directory (the one you started in, in this case, and which contains the folder named Desktop), type the following and then press Return (or Enter):

cd ..

FOLDERS THAT ARE DEEPLY BURIED

Finally, what if you want to change to a folder that’s easy to locate in the Finder, but you don’t want to type all the many folder names leading down, down, down to where it is buried? Easy peasy: Just find the folder the normal way, using the Mac Finder — then click it once (don’t open it) and then press Command-c to copy the “path.”

Return to your Terminal window. Type cd and one space, and then paste (Command-v). Press Return, and bingo! You’re in that directory, no matter how deep down it is.

Each of these steps is illustrated in one of the images above (CLICK for a slideshow of larger images).