Site icon Technology and Trends

How can anyone Navigate on Linux using CD Command?

cd command, also known as chdir​ (change directory),
is a command-line shell command. It is used in navigating the Linux/Unix system and is widely used when writing Shell Script.

Change from Present Working Directory to another directory

cd <Directory Name>

~$ cd <directory_path>
~$ cd /home/nitendratech
cd ~
~$ cd ~
~$ pwd
/home/nitendratech

cd /

:~$ cd /
:/$ pwd
/
:/$

Move to the previous directory from the current directory

We can use the cd command with .. To move to the previous directory.

:~/tutorials$ pwd
/home/nitendratech/tutorials
:~/tutorials$ cd ..
:~$ pwd
/home/nitendratech

Move two directories back from the current directory

W can use this command cd ../.. to move two directories back

:~/tutorials/hive$ pwd
/home/nitendratech/tutorials/hive
:~/tutorials/hive$ cd ../..
:~$ pwd
/home/nitendratech
Exit mobile version