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

How to express relative path in linux

王林
Release: 2020-03-13 11:18:40
Original
5004 people have browsed it

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下
Copy after login

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

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

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目录
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template