How to Go Up Multiple Directories in a Shell?

Find out how to move several directories up in a shell

You can go up multiple levels in a directory structure by using the cd command in a shell followed by the desired number of ../ sequences. For example, to move up three levels, you would use the following command:

cd ../../../

Depending on the shell you're using, you can also create a shortcut in your shell configuration file for moving multiple levels up in a directory structure.

Please note that the cd command only changes the current directory for the current shell session. If you open a new terminal window (or log out and log back in), your current directory will revert to your home directory.

Hope you found this post useful. It was published . Please show your love and support by sharing this post.