Linux file path

How to indicate the path of the Linux file

The file storage structure of Linux is different from that of Windows. It is a tree structure starting from the root directory, and the directory structure is unique. Therefore, in the problem of representing the path of the file, you can refer to the path representation method of the child nodes of the tree. In Linux, there are two ways of representing absolute path and relative path.

Absolute path

The absolute path starts from the root directory, and finds the location of the file layer by layer, and the node passed by is the path.

relative path

The relative path is the path starting from the current directory, and the path representation of a file will vary with the current directory. There are two special expressions "." and "...". Each directory has two subdirectories. "." means the current directory itself, and "..." means the parent directory of the current directory.

example

For example, in the following structure, if you want to indicate the location of the workspace, you can express it in two ways: absolute path and relative path.
Insert picture description here
Absolute path: /dev/
Relative path: If it is currently in the dev directory, it means that the workspace
      is currently in the / directory, it means dev/workspace

Guess you like

Origin blog.csdn.net/dream_i_success/article/details/113366155