Home  >  Article  >  Operation and Maintenance  >  How to express relative path in linux

How to express relative path in linux

王林
王林Original
2020-03-13 11:18:404960browse

How to express relative path in linux

For example, if your current path is /var/log, and now you want to enter the /usr directory, you can execute the following command:

cd ../../usr   #通过相对路径先退到/var目录下,再退到/下,最后进如/usr下

(Recommended tutorial: linux tutorial)
The equivalent path is relative to the current directory.

../        #表示上级目录
./        #表示当前目录下
./XXX    #表示当前目录下的XXX文件或者XXX目录

Using relative paths does not necessarily require returning to the directory.

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

cd ../run   #先退到/var目录,然后进入/var目录下的run目录

Recommended related video tutorials: linux video tutorial

The above is the detailed content of How to express relative path in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn