Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 918 Bytes

File metadata and controls

53 lines (43 loc) · 918 Bytes

cd

The cd command in Linux is used to change the current working directory. This command is fundamental for navigating the filesystem from the command line.

Syntax

cd [directory]

Usage

Change to a Specified Directory

cd /path/to/directory

This command changes the current directory to the /path/to/directory/.

Change to the Home Directory

cd

or

cd ~

Both commands change the current directory to the user's home directory.

Move Up One Directory Level

cd ..

This command changes the current directory to the parent directory.

Change to the Previous Directory

cd -

This command switches back to the previous directory you were in.

Going Up the Directory Tree

cd ../../

Switching Between Two Directories

cd /home/remon/projects/my_project
# Do some work
cd /etc
# Need to go back to the previous directory
cd -