Hi Friends! Today we will learn about the cd command which is used to play with directories and folders. Its full form has the secret what this command do c(change) d(directory).
So, let’s start with the cd command which is mainly used to change the directory in Linux, Windows as well as Unix.
Kindly refer the link so you can practice with us while learning the POST, it will take 40 to 50 seconds to boot the image.
$ cd tastethelinux output: [email protected]:~/tastethelinux$
so we have to change the directory successfully and moved into the folder tastethelinux
But are we in the right folder, so we will look for the new command known as “pwd”?
$ pwd output: /home/tla/tastethelinux
By using the pwd command we got that we are in /home/tla/tastethelinux folder.
pwd command stands for Present Working Directory, it always shows in which directory currently you are.
But what is /home/tla?
So, it is a home directory of the user tla lets see, how we can use with the cd command
So, from the above example, we can say that ~ this sign denotes the home directory of the user tla.
If we are anywhere in the directory we can use cd ~ to switch back to our home directory.
How to switch back to my working directory back tastethelinux use the command?
So, currently, we are in /home/tla/tastethelinux, and will go to the parent directory(means one step back)
[email protected]:~/tastethelinux$ cd ../ [email protected]:~$ pwd output: /home/tla [email protected]:~$
So, we have used “cd ../” command to go one step back.
What if we have to directly go to /home directory you can also use “cd ../../”
[email protected]:~/tastethelinux$ cd ../../ [email protected]:/home$
Let’s Play the Quiz Guys for the cd command, Are you ready to play with tastethelinux?
cd cheat sheet
Thank you so much friends to read this post, Keep Supporting.