Linux目录名含义

 

对于Linux的操作,一直是野路子出身,没有系统学习过,所以最近在看《Linux命令行大全》来系统学习。这本书的第三章《Linux系统》有一部分是解释Linux中各种目录的作用的。这些目录的名称大多都是缩写,但其究竟是什么的缩写和其来由都没有在本书说明,因此我在网上搜索整理的这份文档,以备查阅。

  • /bin - Binaries.
  • /boot - Files required for booting.
  • /dev - Device files.
  • /etc - Et cetera. The name is inherited from the earliest Unixes, which is when it became the spot to put config-files.
  • /home - Where home directories are kept.
  • /lib - Where code libraries are kept.
  • /media - A more modern directory, but where removable media gets mounted.
  • /mnt - Where temporary file-systems are mounted.
  • /opt - Where optional add-on software is installed. This is discrete from /usr/local/ for reasons I’ll get to later.
  • /run - Where runtime variable data is kept.
  • /sbin - Where super-binaries are stored. These usually only work with root.
  • /srv - Stands for “serve”. This directory is intended for static files that are served out. /srv/http would be for static websites, /srv/ftp for an FTP server.
  • /tmp - Where temporary files may be stored.
  • /usr - Another directory inherited from the Unixes of old, it stands for “UNIX System Resources”. It does not stand for “user” (see the Debian Wiki). This directory should be sharable between hosts, and can be NFS mounted to multiple hosts safely. It can be mounted read-only safely.
  • /var - Another directory inherited from the Unixes of old, it stands for “variable”. This is where system data that varies may be stored. Such things as spool and cache directories may be located here. If a program needs to write to the local file-system and isn’t serving that data to someone directly, it’ll go here.
  • /proc - Kernel and process information virtual filesystem. Read it to get the process information as well as other kernel and memory information.

除了下方的参考资料(特别是第三个)之外,还可以输入man heir查看有关Linux File System Hierarchy的手册。

参考资料: