The cd (change directory) command is used to navigate between directories in the file system. Here are some common usages:
-
Change to a specific directory:
cd /path/to/directory -
Change to the home directory:
cd ~ -
Change to the parent directory:
cd .. -
Change to the previous directory:
cd - -
Change to a directory using a relative path:
If you are in/home/userand want to go to/home/user/documents, you can simply use:cd documents
After using the cd command, you can use pwd to verify your current directory.
