在一開始使用Unix-like system時,對於其檔案系統架構。最為不了解,
The Filesystem Hierarchy Standard (FHS) defines the structure of file systems on Linux and other UNIX-like operating systems.
/ – The Root Directory
Everything on your Linux system is located under the / directory, known as the root directory.
/bin – Essential User Binaries
The /bin directory contains the
essential user binaries (programs) that must be present when the system is mounted in single-user mode.
Applications such as Firefox are stored in /usr/bin, while important
system programs and utilities such as the bash shell are located in /bin.
The /sbin directory is similar – it contains
essential system administration binaries.
/boot – Static Boot Files
The /boot directory contains
the files needed to boot the system – for example, the
GRUB boot loader’s files and your
Linux kernels are stored here. The boot loader’s configuration files aren’t located here, though – they’re in /etc with the other configuration files.
/cdrom – Historical Mount Point for CD-ROMs
It’s a
temporary location for CD-ROMs inserted in the system. However, the standard location for temporary media is inside the /media directory.
/dev – Device Files
Linux exposes devices as files, and the /dev directory contains
a number of special files that represent devices.
These are not actual files as we know them, but they appear as files – for example, /dev/sda represents the first SATA drive in the system.
/etc – Configuration Files
The /etc directory contains configuration files, which can generally be edited by hand in a text editor. Note that the /etc/ directory contains system-wide configuration files – user-specific configuration files are located in each user’s home directory.
/home – Home Folders
The /home directory contains a home folder for each user. For example, if your user name is bob, you have a home folder located at /home/bob. This home folder contains the user’s data files and user-specific configuration files.
/lib – Essential Shared Libraries
The /lib directory contains libraries needed by the
essential binaries in the /bin and /sbin folder. Libraries needed by the binaries in
the /usr/bin folder are located in /usr/lib.
/lost+found – Recovered Files
Each Linux file system has a lost+found directory. If the file system crashes, a file system check will be performed at next boot. Any corrupted files found will be placed in the lost+found directory, so you can attempt to recover as much data as possible.
/media – Removable Media
The /media directory contains
subdirectories where removable media devices inserted into the computer are mounted.
For example, when you insert a CD into your Linux system, a directory will automatically be created inside the /media directory. You can access the contents of the CD inside this directory.
/mnt – Temporary Mount Points
Historically speaking, the /mnt directory is where system administrators mounted temporary file systems while using them. For example, if you’re mounting a Windows partition to perform some file recovery operations, you might mount it at /mnt/windows. However, you can mount other file systems anywhere on the system.
/opt – Optional Packages
The /opt directory contains
subdirectories for optional software packages. It’s commonly used by proprietary software that doesn’t obey the standard file system hierarchy – for example, a proprietary program might dump its files in /opt/application when you install it.
/proc – Kernel & Process Files
The /proc directory similar to the /dev directory because it doesn’t contain standard files. It contains special files that
represent system and process information.
/sbin – System Administration Binaries
The /sbin directory is similar to the /bin directory. It contains essential binaries that are generally intended to be run by the root user for system administration.
/selinux – SELinux Virtual File System
If your Linux distribution uses SELinux for security (Fedora and Red Hat, for example), the /selinux directory contains special files used by SELinux.
none.
/srv – Service Data
The /srv directory contains “
data for services provided by the system.” If you were using the Apache HTTP server to serve a website, you’d likely store your website’s files in a directory inside the /srv directory.
/tmp – Temporary Files
Applications store temporary files in the /tmp directory. These files are generally deleted whenever your system is restarted and may be deleted at any time by utilities such as tmpwatch.
/usr – User Binaries & Read-Only Data
The /usr directory contains applications and files used by users, as opposed to applications and files used by the system. For example, non-essential applications are located inside the /usr/bin directory instead of the /bin directory and non-essential system administration binaries are located in the /usr/sbin directory instead of the /sbin directory
/var – Variable Data Files
The /var directory is the writable counterpart to the /usr directory, which must be read-only in normal operation. Log files and everything else that would normally be written to /usr during normal operation are written to the /var directory. For example, you’ll find log files in /var/log.