To change the current directory in Bash, you use the cd (change directory) command. Here’s how to do it:
Basic Usage:
cd /path/to/directory
Examples:
-
Change to a specific directory:
cd /home/user/Documents -
Change to the parent directory:
cd .. -
Change to the home directory:
cd ~or simply:
cd -
Change to the previous directory:
cd -
Tips:
- Use
pwdto print the current working directory after changing it to confirm the change. - You can use tab completion to help with directory names.
Let me know if you need further assistance!
