Linux cd Command
The "cd" stands for 'change directory' and this command is used to change the current directory i.e; the directory in which the user is currently working.
It is the most important and common command and will be used many times. With the help of this command you can move all over your directories in your system. You can go to your previous directory or previous to previous directory, or anywhere. Now let's see how.
1) Change from current directory to a new directory
In the snapshot, first I have given pwd command, it brings me to the current directory, that is /home/sssit. Now I have given the command 'cd' to change my current directory and have mentioned the path for the new directory /home/sssit/Desktop. Now as you can see I'm on my new directory that is Desktop. And now my current working directory has changed toDesktop.
2) Change directory using absolute path
In absolute path we have to mention whole path starting from root.
In above example, we want to change our directory to 'certs' from 'cups'. So we are providing the whole path /run/cups/certs starting from the root (/). This is called absolute path.
3) Change directory using relative path
This exmple is same as the above one. Only difference is that we are providing relative path. Look, here also we have changed our directory from 'cups' to 'certs' but have not mentioned the whole path. This is the relative path.