To change the current working directory in Linux, you can use the cd (change directory) command. Here’s how to do it:
-
Basic Usage:
To change to a specific directory, use:cd /path/to/directory -
Relative Path:
If you want to change to a directory relative to your current location, you can do:cd directory_name -
Parent Directory:
To move up one level to the parent directory, use:cd .. -
Home Directory:
To change to your home directory, simply use:cd ~or just:
cd -
Using Absolute Path:
You can specify the full path to change to any directory:cd /home/username/documents -
Check Current Directory:
After changing directories, you can confirm your current working directory by using:pwd
These commands will help you navigate the file system effectively.
