Skip to content

Help us create more tutorials! Make a donation using the Donate button or become a member using the button below to hide this banner and track your progress.

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 Course > Terminal Basic Commands