Get the App
SLTechnology News&Howtos  ›  Servers  › 

The origin of Unix directory structure

Shulou Source: shulou.com Published: 2022-06-02 16:58:49 09月22日 Update

Author: Ruan Yifeng

Date: February 6, 2012

Beginners of Unix (including Linux) are often confused about what the directory structure means.

For example, there is a subdirectory / bin under the root directory that holds binaries. However, there is also / usr/bin under the / usr subdirectory, as well as / usr/local/bin, which is also used to hold binary programs; some systems even have / opt/bin. What's the difference between them?

For a long time, I also feel very confused, do not understand why this design. Like most people, I just memorize the differences between different directories according to the Unix File system structure Standard (Filesystem Hierarchy Standard).

Yesterday, I read a brief explanation of Rob Landley, and it suddenly dawned on me that the Unix directory structure is caused by history.

In 1969, Ken Thompson and Dennis Ritchie invented Unix on the minicomputer PDP-7. In 1971, they upgraded the mainframe to PDP-11.

At that time, they used a storage disk called RK05, which had a capacity of about 1.5MB.

Before long, the operating system (root directory) became so large that a single disk could no longer fit. So, they added the second RK05, and stipulated that the first disk was dedicated to the system program, and the second disk was dedicated to the user's own program, so the mounted directory point was named / usr. That is, the root directory "/" is mounted on the first disk, and the "/ usr" directory is mounted on the second disk. In addition, the directory structure of the two disks is exactly the same, and the directories of the first disk (/ bin, / sbin, / lib, / tmp...) reappear under the / usr directory.

Later, the second disk was full, so they had to add a third RK05, which was mounted with a directory named / home, and stipulated that / usr was used to store the user's program, and / home was used to store the user's data.

Since then, this directory structure has continued. As the capacity of the hard disk becomes larger and larger, the meaning of each directory is further clarified.

/: store system programs, that is, Unix programs developed by At&t.

/ usr: stores programs developed by Unix system vendors such as IBM and HP.

/ usr/local: stores the programs installed by the user.

/ opt: in some systems, it is used to store programs developed by third-party vendors, so it is named option, which means "optional".

(end)

Copyright notice of document Information: free reprint-non-commercial-non-derivative-keep signature | Creative Commons BY-NC-ND 3.0original URL: http://www.ruanyifeng.com/blog/2012/02/a_history_of_unix_directory_structure.html

Tags: Directory program system structure user root directory development that is binary meaning subdirectory subdirectory capacity more and more different same short incomprehensible confused Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker MariaDB Redmi Shulou Technology Microsoft