cd
Shell builtin: cd
Changes the directory.
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
Examples
cd Documents
pwd
/home/lerner/Documents
cd ..
pwd
/home/lerner cd /home/lerner/projects
pwd
/home/lerner/projects cd projects/website
cd ..
pwd
/home/lerner/projects cd /tmp
cd -
/home/lerner
cd -
/tmp cd /var/log/app
cd -
/home/lerner
cd -
/var/log/app
cd
pwd
/home/lerner cd logs
cd -
/home/lerner cd logs
cd
pwd
/home/lerner Where you learn it
Lessons
- Where am I? pwd, ls and cd Terminal start
- Paths: absolute, relative, ~ and .. Terminal start
- Paths: absolute, relative, ~ and .. Terminal start
- Paths: absolute, relative, ~ and .. Terminal start
- Finding your way around a strange server Linux Basics, Module 1: Survival basics