linux 目录结构_Linux目录结构,解释
linux 目錄結構
If you’re coming from Windows, the Linux file system structure can seem particularly alien. The C:\ drive and drive letters are gone, replaced by a / and cryptic-sounding directories, most of which have three letter names.
如果您來自Windows,那么Linux文件系統的結構似乎特別陌生。 C:\驅動器和驅動器號不見了,取而代之的是一個/和聽起來有些神秘的目錄,其中大多數都有三個字母名稱。
The Filesystem Hierarchy Standard (FHS) defines the structure of file systems on Linux and other UNIX-like operating systems. However, Linux file systems also contain some directories that aren’t yet defined by the standard.
文件系統層次結構標準(FHS)定義了Linux和其他類似UNIX的操作系統上文件系統的結構。 但是,Linux文件系統還包含一些標準尚未定義的目錄。
/ –根目錄 (/ – The Root Directory)
Everything on your Linux system is located under the / directory, known as the root directory. You can think of the / directory as being similar to the C:\ directory on Windows – but this isn’t strictly true, as Linux doesn’t have drive letters. While another partition would be located at D:\ on Windows, this other partition would appear in another folder under / on Linux.
Linux系統上的所有內容都位于/目錄(稱為根目錄)下。 您可以將/目錄視為類似于Windows上的C:\目錄–但這并非完全正確,因為Linux沒有驅動器號。 在Windows上,另一個分區位于D:\,而在Linux上,該另一個分區將顯示在/下的另一個文件夾中。
/ bin –基本用戶二進制文件 (/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 /usr directory may be stored on another partition – placing these files in the /bin directory ensures the system will have these important utilities even if no other file systems are mounted. The /sbin directory is similar – it contains essential system administration binaries.
/ bin目錄包含在單用戶模式下安裝系統時必須存在的基本用戶二進制文件(程序)。 諸如Firefox之類的應用程序存儲在/ usr / bin中,而重要的系統程序和實用程序(例如bash shell)則位于/ bin中。 / usr目錄可以存儲在另一個分區上-將這些文件放在/ bin目錄中可確保即使沒有安裝其他文件系統,系統也將具有這些重要的實用程序。 / sbin目錄類似–它包含基本的系統管理二進制文件。
/ boot –靜態啟動文件 (/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.
/ boot目錄包含啟動系統所需的文件,例如,GRUB引導加載程序的文件和Linux內核存儲在此處。 但是,引導加載程序的配置文件不在此處-與其他配置文件位于/ etc中。
/ cdrom – CD-ROM的歷史掛載點 (/cdrom – Historical Mount Point for CD-ROMs)
The /cdrom directory isn’t part of the FHS standard, but you’ll still find it on Ubuntu and other operating systems. It’s a temporary location for CD-ROMs inserted in the system. However, the standard location for temporary media is inside the /media directory.
/ cdrom目錄不是FHS標準的一部分,但是您仍然可以在Ubuntu和其他操作系統上找到它。 這是插入系統的CD-ROM的臨時位置。 但是,臨時媒體的標準位置在/ media目錄中。
/ dev –設備文件 (/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. If you wanted to partition it, you could start a partition editor and tell it to edit /dev/sda.
Linux將設備公開為文件,/ dev目錄包含許多代表設備的特殊文件。 這些不是我們所知道的實際文件,而是顯示為文件–例如,/ dev / sda表示系統中的第一個SATA驅動器。 如果要對其進行分區,可以啟動分區編輯器,并告訴它編輯/ dev / sda。
This directory also contains pseudo-devices, which are virtual devices that don’t actually correspond to hardware. For example, /dev/random produces random numbers. /dev/null is a special device that produces no output and automatically discards all input – when you pipe the output of a command to /dev/null, you discard it.
該目錄還包含偽設備,它們是實際上與硬件不對應的虛擬設備。 例如,/ dev / random產生隨機數。 / dev / null是一種特殊的設備,它不產生任何輸出并自動丟棄所有輸入–當將命令的輸出通過管道傳輸到/ dev / null時,將其丟棄。
/ etc –配置文件 (/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.
/ etc目錄包含配置文件,通常可以在文本編輯器中手動對其進行編輯。 請注意,/ etc /目錄包含系統范圍的配置文件–特定于用戶的配置文件位于每個用戶的主目錄中。
/ home –主文件夾 (/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. Each user only has write access to their own home folder and must obtain elevated permissions (become the root user) to modify other files on the system.
/ home目錄包含每個用戶的主文件夾。 例如,如果您的用戶名為bob,則您的主文件夾位于/ home / bob。 此主文件夾包含用戶的數據文件和用戶特定的配置文件。 每個用戶僅對其自己的主文件夾具有寫訪問權,并且必須獲得提升的權限(成為root用戶)才能修改系統上的其他文件。
/ lib –基本共享庫 (/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.
/ lib目錄包含/ bin和/ sbin文件夾中的基本二進制文件所需的庫。 / usr / bin文件夾中的二進制文件所需的庫位于/ usr / lib中。
/ lost + found –恢復的文件 (/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.
每個Linux文件系統都有一個lost + found目錄。 如果文件系統崩潰,則將在下次啟動時執行文件系統檢查。 找到的任何損壞的文件將放置在lost + found目錄中,因此您可以嘗試恢復盡可能多的數據。
/ media –可移動媒體 (/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.
/ media目錄包含安裝在計算機中的可移動媒體設備所在的子目錄。 例如,當您將CD插入Linux系統時,將在/ media目錄中自動創建一個目錄。 您可以在此目錄中訪問CD的內容。
/ mnt –臨時掛載點 (/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.
從歷史上看,/ mnt目錄是系統管理員在使用它們時掛載臨時文件系統的位置。 例如,如果要安裝Windows分區以執行某些文件恢復操作,則可以將其安裝在/ mnt / windows。 但是,您可以在系統上的任何位置掛載其他文件系統。
/ opt –可選軟件包 (/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.
/ opt目錄包含可選軟件包的子目錄。 不符合標準文件系統層次結構的專有軟件通常使用它-例如,專有程序在安裝時可能會將其文件轉儲到/ opt / application中。
/ proc –內核和進程文件 (/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.
/ proc目錄類似于/ dev目錄,因為它不包含標準文件。 它包含代表系統和過程信息的特殊文件。
/ root –根主目錄 (/root – Root Home Directory)
The /root directory is the home directory of the root user. Instead of being located at /home/root, it’s located at /root. This is distinct from /, which is the system root directory.
/ root目錄是root用戶的主目錄。 它不是位于/ home / root,而是位于/ root。 這不同于/,后者是系統根目錄。
/ run –應用程序狀態文件 (/run – Application State Files)
The /run directory is fairly new, and gives applications a standard place to store transient files they require like sockets and process IDs. These files can’t be stored in /tmp because files in /tmp may be deleted.
/ run目錄是一個相當新的目錄,它為應用程序提供了一個標準位置來存儲所需的臨時文件,例如套接字和進程ID。 這些文件無法存儲在/ tmp中,因為/ tmp中的文件可能已刪除。
/ sbin –系統管理二進制文件 (/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.
/ sbin目錄類似于/ bin目錄。 它包含基本二進制文件,這些二進制文件通常由root用戶運行以進行系統管理。
/ selinux – SELinux虛擬文件系統 (/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. It’s similar to /proc. Ubuntu doesn’t use SELinux, so the presence of this folder on Ubuntu appears to be a bug.
如果您Linux發行版使用SELinux進行安全保護(例如,Fedora和Red Hat),則/ selinux目錄包含SELinux使用的特殊文件。 它類似于/ proc。 Ubuntu不使用SELinux,因此在Ubuntu上存在此文件夾似乎是一個錯誤。
/ srv –服務數據 (/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.
/ srv目錄包含“系統提供的服務的數據”。 如果您使用Apache HTTP服務器為網站提供服務,則可能會將網站的文件存儲在/ srv目錄中的目錄中。
/ tmp –臨時文件 (/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.
應用程序將臨時文件存儲在/ tmp目錄中。 通常,每當系統重新啟動時,這些文件都會被刪除,tmpwatch等實用程序可能會隨時刪除這些文件。
/ usr –用戶二進制文件和只讀數據 (/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. Libraries for each are located inside the /usr/lib directory. The /usr directory also contains other directories – for example, architecture-independent files like graphics are located in /usr/share.
/ usr目錄包含用戶使用的應用程序和文件,而不是系統使用的應用程序和文件。 例如,非必需應用程序位于/ usr / bin目錄中,而不是/ bin目錄中;非必需系統管理二進制文件位于/ usr / sbin目錄中,而不是/ sbin目錄中。 每個庫都位于/ usr / lib目錄中。 / usr目錄還包含其他目錄-例如,與體系結構無關的文件(例如圖形)位于/ usr / share中。
The /usr/local directory is where locally compiled applications install to by default – this prevents them from mucking up the rest of the system.
默認情況下,/ usr / local目錄是本地編譯的應用程序安裝到的目錄–這樣可以防止它們破壞系統的其余部分。
/ var –可變數據文件 (/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.
/ var目錄是/ usr目錄的可寫副本,/ usr目錄在正常操作中必須為只讀。 日志文件和在正常操作期間通常會寫入/ usr的所有其他內容都寫入/ var目錄。 例如,您將在/ var / log中找到日志文件。
For more detailed technical information about the Linux file system hierarchy, consult the Filesystem Hierarchy Standard documentation.
有關Linux文件系統層次結構的更多詳細技術信息,請查閱Filesystem Hierarchy Standard文檔。
翻譯自: https://www.howtogeek.com/117435/htg-explains-the-linux-directory-structure-explained/
linux 目錄結構
總結
以上是生活随笔為你收集整理的linux 目录结构_Linux目录结构,解释的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 微信端ASP点检巡查程序
- 下一篇: 重風巽