How to change the current working directory in Bash?

To change the current working directory in Bash, you can use the cd command followed by the directory you want to navigate to.

Here are some examples:

  1. To navigate to a directory within the current directory:
cd directory_name
  1. To navigate to a specific directory path:
cd /path/to/directory
  1. To navigate to the parent directory:
cd ..
  1. To navigate to the home directory:
cd ~
  1. To navigate to the previous directory:
cd -

Remember to replace directory_name with the actual name of the directory or /path/to/directory with the actual directory path.