The “Change Directory” (cd) command in Linux modifies the user’s current working directory. The command helps to move around in the file system’s directories. The use of this command is really crucial to learn.
example syntax
cd [directory]
Where directory denotes the location of the desired directory by its path. The command will send you to the user’s home directory if you don’t provide a directory.
Flags/options available with cd command
- “-“ : use this option to go to the previous working directory.

- “~” : Use this option to access the user’s home directory.

- “..” : With this option with cd changes the current working directory to the parent directory.


Special Note: As shown in the examples “pwd” command have been used to know more about the command
Use of pwd Command
One of the most often used commands in Linux is the cd command, which enables users to enter various directories, travel across the file system, and carry out various activities. The command comes in handy when you need to access a particular file or directory or when you need to change directories in order to run other commands.
It’s important to note that the cd command lacks flags; the parameters I previously described are instead shortcuts for navigating between folders.
In addition to the previously listed choices, you can also access a directory by using its complete path by using the cd. As an illustration, to access the directory /home/user/documents, you can use the command:
cd /home/user/documents