cd command is used to change the working directory.
cd stands for changing directory.
For example, We have to change the working directory to the bin directory. The command is
The / is given because the bin directory is inside the parent directory.
Linux file systems can be navigated with the help of an absolute path and relative path.
The absolute path starts with a
'/'. This means that the path begins from the root directory[Parent directory].
For example, We can go to the Practice directory in Two methods as below
By using the absolute path
By using the relative path
cd /home cd saby cd Documents cd Practice
The relative path does not start with a
'/'. It determines the location relative to the present position.
Now to change the directory one step behind i.e from the bin directory to the / directory, the command is
To change the directory from the /bin directory to the home directory of the user the command is
By using the below command you can also change the directory from the /bin to the home directory.
popd are Linux command in a bash shell and certain other shells which saves current working directory location to memory and bring to the directory from memory as the current working directory, respectively as well as changes directory.
The above command saves the current location to memory and changes to the requested directory. As soon as popd is fired, it fetches the saved directory location from memory and makes it the current working directory.
If there are issues with the change directory, check the parameters:
Let us run the command PWD from the prompt. The current working directory in /home/saby is displayed.
where the 1st slash is for the parent directory (i.e)Root. Inside the parent directory, the home directory is present and inside the home directory, the Saby user is present in which we are currently working.