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/directoryRelative Path: If you want to change to a directory relative to your current location, you can do:
cd directory_nameParent 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:
cdUsing Absolute Path: You can specify the full path to change to any directory:
cd /home/username/documentsCheck 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.
