cd - Change the shell working directory.
cd [-L|-P] [dir]
Change the shell working directory. Change the current directory to DIR. The default DIR is the value of the HOME shell variable.
|-L||force symbolic links to be followed|
use the physical directory structure without following symbolic links
To change directory to /var/log :
$ cd /var/log
To change directory to parent directory.
$ cd ..
To force symbolic links to be followed while changing directory.
$ cd -L /home/user Note: user is symbolic link to another directory.
To use the physical directory structure without following symbolic links while changing directory.
$ cd -P /home/user Note: user is symbolic link to another directory.
To move to your home directory:
if our username is abc, and our home directory is /home/abc , the command:
$ cd ~
$ cd /home/abc
To Move two directory up from where you are now.
nubo@nubo:/var/log$ cd ../../
To Move to root directory:
nubo@nubo:~$ cd /