Get the App
SLTechnology News&Howtos  ›  Servers  › 

The representation of relative paths in linux

Shulou Source: shulou.com Published: 2022-06-03 07:52:58 09月21日 Update

Today, the editor shares with you the expression of the relative path in linux, which is not well understood by many people. Today, in order to give you a better understanding of the expression of the relative path in linux, I have summarized the following and let's look down together. I'm sure you'll get something.

For example, if you want to enter the / usr directory under the current path of / var/log, you can execute the following command:

Cd. /.. / usr # retreats to the / var directory through the relative path, then to /, and finally to / usr

The equivalent path is relative to the current directory.

.. / # indicates the parent directory. / # indicates the current directory. / XXX # indicates the XXX file or the XXX directory under the current directory

You don't have to go back to the directory to use a relative path.

If the current path is / var/log, you want to go to / var/run/.

Cd.. / run # retreat to the / var directory, and then go to the run directory under the / var directory

The above is a brief introduction to the representation of the relative path in linux. Of course, the differences in the detailed use of the above have to be understood by everyone. If you want to know more, welcome to follow the industry information channel!

Tags: Directory path method different abbreviated superior content command that is file more look industry information information channel face channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi MySQL Shulou Tech Info macOS Shulou Technology