Linux Basic Commands
3. cd
cd Command in Linux
cd stands for Change Directory.
It is used to navigate between folders in the Linux file system.
🔹 Basic Syntax:
cd [directory_path]
cd /etc/sysconfig
🔹 Common Examples:
-
Go to a specific directory
cd /etc/sysconfig/network-scripts
👉 Moves you to the Documents folder.
-
Go to your home directory
cd
or
cd ~
👉 Takes you to your user's home directory, like /home/ashwin.
-
Go back to the previous directory
cd ..
👉 Takes you to the previous directory you were in.
-
Navigate using relative path
cd /var/log
👉 Moves into /var/log from your current location.
🔹 Check Your Location:
Use pwd to confirm where you are after using cd.
Try with Linux Practice