"How do I get out of here?"
The cd command changes the current working directory (folder), allowing you to move between directories (folders) on the filesystem.
cd - change directory
cd stands for change directory.
cd -: Change to the previous working directory
cd ..cd ../..cd ../another-directorycd -cd
cd ~
cd /Users/<username>
cd $HOMEcd /cd ~/Desktop
cd [directoryName]
cd [directoryName/subDirectoryName]| Command | What It Does | Example |
|---|---|---|
cd |
Go to home directory | cd → /Users/<username> |
cd ~ |
Go to home directory | cd ~ → /Users/<username> |
cd .. |
Go up one level | From current directory to parent |
cd ../.. |
Go up two levels | From current directory up two levels |
cd - |
Go back to previous directory | Switches between last two directories |
cd / |
Go to root directory | cd / → / |
cd ~/Desktop |
Go to Desktop | cd ~/Desktop → ~/Desktop |
cd ../another-directory |
Go to sibling directory | From one folder to its sibling |
cd "My Documents"
# or
cd My\ Documents






