Home > Article > Operation and Maintenance > How to write relative path in linux?
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 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!