Not to be confused with Compact disk (CD)


The cd command allows you to change your current working directory. The cd command is built right into the shell and is not a program

Example

In this example we change out directory to the wiki folder and back to the root of the wiki.

lewis@Lewiss-MacBook-Air obsidian_tech_wiki % cd Wiki
lewis@Lewiss-MacBook-Air Wiki % cd ..
lewis@Lewiss-MacBook-Air obsidian_tech_wiki %

Shortcuts

You can use shortcuts to move to a special directory in the system.

  • / - Move to the root of the dir.
  • ~ - Move to your home or root folder (Can be used with only the cd command on its own).
  • .. - Move back a directory .