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

How to write relative path in linux?

藏色散人
藏色散人Original
2019-05-20 17:54:2720929browse

The relative path is relative to the directory where the program is currently located, and the current directory continues to change as the program is executed.

How to write relative path in linux?

#How to write the relative path in Linux?

Relative path:

The way to write the path is not to start with /. For example, when going from /usr/share/doc to the bottom of /usr/share/man, it can be written as: cd ../man This is how to write relative paths!

In the Linux file system, there are two special symbols that can also represent directories:

"." represents the current directory

".." indicates the upper-level directory of the current directory

Note: Although relative paths are flexible, they are not very safe. It is possible to miss or confuse the current directory. , causing an error. Therefore, you can use relative paths for personal operations, but the software installation directory must be correct. Absolute paths are the only wise choice.

The above is the detailed content of How to write 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