Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Podia.

Change directories – Terminal

Summary

To change directories in your terminal, enter the following command:

cd folder-name/

Details

The above command will move you into the specified directory if it exists in the current directory.

If you need to change into a directory that’s not inside your current directory, you’ll have to use some shortcuts.

To move into a folder relative to the user directory, you would use the ~ character:

cd ~/Documents/

cd ~/Desktop/Projects/

You can also use two periods (..) to move up a folder first, then specify a path:

cd ../Projects/Web/

Exercises

Try the following command in your project folder:

cd subfolder

References

Command Line Primer on the Apple Developer Archive (see the sections called Specifying Files and Directories and Frequently Used Commands)

Back to: Terminal Reference > Terminal Basic Commands