Home  >  Article  >  Operation and Maintenance  >  How to write the linux file path?

How to write the linux file path?

藏色散人
藏色散人Original
2019-05-18 10:52:308680browse

How to write the linux file path?

The path is in the form of a tree, the starting point is the root, represented by the symbol "/", the absolute path starts with /. All disk partitions in Linux are hung in the root directory "/" Below.

For example, there is a hard disk in a LINUX, and a hard disk has four partitions. If the partition is the main area, it is represented as sda1 sda2 sda3 sda4.

If there is only one primary partition and the others are logical partitions, they are represented as sda1 sda5 sda6 sda7 (older LINUX versions recognize the hard disk as hda). These four partitions have at least one root partition /, and at least One partition is the swap partition (that is, the virtual memory partition), and the other two partitions can be mounted in the directory of the root partition according to actual needs.

For example, among the four partitions above, sda1 is In the root partition, sda5 is the swap partition. There are two directories home and mnt under the root partition of sda1. Therefore, the partitions sda6 and sda7 must not be mounted in the home mnt directory. Then the paths of partitions sda6 and sda7 are expressed as /home/ mnt

For another example, if a file a.txt is stored in the home directory, the path is expressed as /home/a.txt. This can be understood as storing a file a.txt under the partition sda6.

How to write the Linux file path?

To put it simply, add the things you usually click with the mouse after /, write / after each click, and click again For what is in that folder, just continue/write the name after that

For example: this is the configuration file path after the apache rpm package software is installed: /etc/httpd/conf/httpd.conf

The same goes for other files. You can use the cd command to switch paths: cd /usr/local

You can also use the pwd command to display the current path.

The above is the detailed content of How to write the linux file path?. 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