terminal.cab

All commands

cd

Topic: Files and folders

Shell builtin: cd

Changes the directory.

Package: core-shell

Usage

cd [-L|-P] [dir]

Description

Go to DIR. Without DIR the shell goes to $HOME, with - back to $OLDPWD. -P resolves symbolic links first.

Options in the simulator

No options.

4 more options of the real program, not in the simulator yet
  • -L not in the simulator yet

    Explanation to come

  • -P not in the simulator yet

    Explanation to come

  • -e not in the simulator yet

    Explanation to come

  • -@ not in the simulator yet

    Explanation to come

Examples

From the lesson Where am I? pwd, ls and cd
cd Documents
pwd
/home/lerner/Documents
cd ..
pwd
/home/lerner

Try it in the terminal

From the lesson Paths: absolute, relative, ~ and ..
cd /home/lerner/projects
pwd
/home/lerner/projects

Try it in the terminal

From the lesson Paths: absolute, relative, ~ and ..
cd projects/website
cd ..
pwd
/home/lerner/projects

Try it in the terminal

From the lesson Paths: absolute, relative, ~ and ..
cd /tmp
cd -
/home/lerner
cd -
/tmp

Try it in the terminal

From the lesson Finding your way around a strange server
cd /var/log/app
cd -
/home/lerner
cd -
/var/log/app
cd
pwd
/home/lerner

Try it in the terminal

From the command of the day: cd -
cd logs
cd -
/home/lerner

Try it in the terminal

From the command of the day: cd without a target
cd logs
cd
pwd
/home/lerner

Try it in the terminal

Where you learn it

Lessons

Command of the day

All commands