How To: Linux / Unix Move Directory Up One Level

How To: Linux / Unix Move Directory Up One Level

To move a directory up one level in Linux or Unix, you can use the cd command followed by the .. path.

For example, if you are currently in the directory /path/to/dir, and you want to move up one level to the /path directory, you can use the following command:

cd ..
S‮www:ecruo‬.lautturi.com

This will move you up one level to the parent directory of the current directory.

You can also use the cd command to move up multiple levels at once by using the .. path multiple times. For example, to move up two levels from the /path/to/dir directory to the / root directory, you can use the following command:

cd ../..

This will move you up two levels to the grandparent directory of the current directory.

Keep in mind that the cd command only changes the current working directory for the current shell session. If you want to change the current working directory permanently, you will need to update the $HOME environment variable or the cd alias in the shell configuration file (e.g. ~/.bashrc, ~/.zshrc, etc.).

You can also use the cd command to move to a specific directory by specifying the path to the directory. For example, to move to the /path/to/dir directory, you can use the following command:

cd /path/to/dir

This will change the current working directory to the specified directory.

Created Time:2017-10-29 22:08:34  Author:lautturi