Linux cd command
The cd command stands for “change directory”. This command is used to leave current directory and navigate to another directory on the system.
cd <Path to new dir>
Change to a New Directory
After login to the system, the user gets the home directory. Now you can navigate to another directory for example /home/rahul/Workspace where my present directory is /home/rahul
Use pwd to check your present working directory.
There are two ways to navigate between directories is the absolute path and relative path.
The Absolute Path vs Relative Path
An absolute path is a complete path to the directory from the root directory (/). In simple terms, all the path started with a slash (/) are an absolute path. For example:
You can see all the above paths are started with a slash (/).
Any path which is not started with a slash (/) is a relative path. For example:
Change Directory with Absolute Path
Changing to directory /home/rahul/Workspace with absolute directory using the cd command.
Change Directory with Relative Path
Changing to the directory Linux/Guides with relative path using the cd command.
The cd Options
Use below options to understand the uses of cd command.