Changing directories with cd

In order to explore UNIX and its capabilities, you'll need to move around among the directories. You do so using the cd command, which takes you from the directory you're currently in to one that you specify. Code Listing 1.4 illustrates how you use cd to change directories.

To change directories:

  • cd Projects
    To move to a specific directory, type cd plus the name of the directory. In this example, we move down in the directory tree to a subdirectory called Projects. See the sidebar called Moving up and down on page 11 for an explanation of what "up" and "down" mean in UNIX terms.
  • cd ..
    Type cd .. to move up one level in the directory tree.
  • cd /etc
    Here, /etc tells the system to look for the etc directory located ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.