Linux Commands
Computer Tutorial

cd command in Linux



cd command in Linux

cd is among the commands you will use most often on the command line. It changes your working directory. Use it to move around within the hierarchy of your file system.

Synopsis :

cd [-L | -P [-e]] directory




Example :

cd documents/work/accounting
cd /
cd ..


Options :

-L This option is the default behavior of cd; normally, it will always act as if -L has been specified.
-P Use the physical directory structure without following symbolic links. In other words, only change into the specified directory if it actually exists as named; symbolic links will not be followed.
-e If the -P option is specified, and the current working directory cannot be determined, this option tells cd to exit with an error. If -P is not specified along with this option, this option has no fun