How to change current directory?

QuestionsQuestions8 SkillsProBasic Files OperationsAug, 19 2025
0151

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:

  1. Change to a specific directory:

    cd /home/user/Documents
  2. Change to the parent directory:

    cd ..
  3. Change to the home directory:

    cd ~

    or simply:

    cd
  4. Change to the previous directory:

    cd -

Tips:

  • Use pwd to 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!

0 Comments

no data
Be the first to share your comment!