cd

Move between folders in the terminal: up a level, back home, back where you were.

>_ Try it: a simulated Linux, right here
Loading the terminal…

Examples

  • cd /etc
  • cd ..
  • cd -
  • cd ~
  • cd app

How it works

cd changes the folder you are in. Give it a path: absolute (starting with /, from the top of the disk) or relative (from where you are now).

It prints nothing when it works. Type pwd to see where you are; the prompt shows it too.

Syntax

cd [FOLDER]

Options

OptionWhat it does
..the folder above this one
~your home folder (cd alone does the same)
-the folder you were in before
/the very top of the file system

Good to know

  • Tab completes folder names: type cd ap and press Tab.
  • Folder names with spaces need quotes: cd "My Files".