Linux directory Structure
/
root directory
/bin
This directory contains commands to complete basic maintenance tasks that are available to all users. Where bin is a binary abbreviation that represents a binary file, typically an executable file. This directory is already included in your "path" system variable. What do you mean? is: When you enter LS in the terminal, the system will go to the/bin directory to find out if there is LS this program.
/boot
Here are some of the core files used when starting Linux. such as operating system kernel, boot program grub and so on.
/ DevThe main store is the files related to the device (including peripherals) (Unix and Linux systems treat the device as a file). Do you want to connect the printer? The system starts working from this directory. There are also some disk drivers, USB drivers, etc. are put in this directory./ etc
Here the main storage system and application software configuration aspects of the file. For example: You installed the Samba suite, and when you want to modify the Samba configuration file, you will find that they (config file) are in the/etc/samba directory. /HomeStores the user's personal files. Each user's home directory is /HomeUnder the name of your own username/libThis directory contains the system's most basic shared-link libraries and kernel modules. The shared link library is functionally similar to a. dll file in Windows./lib64The 64-bit system has a library of this folder, 64-bit programs./lost+foundThis is not part of the Linux directory structure, but rather the place where the Ext3 file system is used to save lost files. Improper shutdown and disk errors can result in file loss, which means that these are labeled "in use" but are not listed on the data structure on disk. Normally, the boot process runs the FSCK program, which can discover these files. In addition to this directory on the "/" partition, there is a lost+found directory on each partition./mediaRemovable device mount point, the current operating system will usually be a USB drive and other devices automatically mounted to the folder./mntA temporary place to mount the file system. In general, this directory is empty, and when we are going to mount the partition, we will set up a directory in this directory, and then mount the device we are going to access in this directory so that we can access the file. (Note that in GNOME, only mount to/mediafolder is displayed in computer, mounted to/mntWill not be displayed as a special device, see automatic mount Partition)/optHere the main storage of those optional programs. Do you want to try the latest Firefox beta? Put it in the/opt directory, so that when you're done trying to erase Firefox, you can simply delete it without affecting any other settings on the system. The program installed in the/OPT directory, all of its data, library files, etc. are placed under the same directory./procIt is a virtual file system that exists in memory. It holds the kernel and process state information. Many are text files and can be viewed directly. Such as/proc/cpuinfoThe information about the CPU is saved./rootThis is the directory of the system administrator (root user). For the system, the system administrator is like God, it can do anything to the system, even including deleting your files. Therefore, be careful with the root account./sbinExecutable files for super users, many of which are system administration commands such as fsck, reboot, shutdown, ifconfig, etc./ tmp
This is the temp directory. For some programs, some files are used two times a time, they are no longer used, and files like this are placed here. Some Linux systems automatically clean up this directory on a regular basis, so don't put important data here.
/ usrStatic user-level applications, etc., see below./ var dynamic program data, see below.
/USR directory structure
/ usr is typically a large folder under which the directory structure is similar to the root directory, but the files in the root directory are mostly system-level files, and/ usr is a user-level file that is generally independent of the specific system.
It should be noted that the program configuration files, Dynamic Data files, etc. will not be stored to/ usr, so in addition to installing, uninstalling the software, generally do not need to modify the content in/ usr . Said/usr can even be read-only mounted while the system is operating normally. Because of this feature,/usr is often divided into separate partitions, and sometimes multiple computers can share a/ usr.
/usr/binThe vast majority of users can use the instructions are placed here! Please note the difference between him and/bin. /usr/includedirectory where the C + + header files are stored/usr/libsystem's library file/usr/local
The main store is the manually installed software, and the/usr directory has a similar directory structure. For example, your distribution provides older software, you want to install newer software but do not want to remove the old version, you can install the new version of the software in the/usr/local/directory, can be different from the original version of the software.
/usr/sbinsystem directives required for non-system normal operation/usr/shareschema-independent data. Most software is installed here. /USR/X11R6This directory is used to save all the files that are required to run X-window. The directory also contains the configuration files and binaries that are used to run the GUI. The name is X11R6 because the final x version is the 11th edition, and the 6th release of the version is intended. /usr/srcThe general source code is suggested to be placed here, SRC has the meaning of source.
/ VAR directory structure
The/ var includes some data files, such as system logs. The storage of/ var makes it possible for/ usr to be read-only mounted.
-
/var/cache
-
Cache files for Applications
-
/var/lib
-
The information and data of the application. such as database data, etc. are stored in this folder.
-
/var/local
-
Information and data of the program in /usr/local
-
/var/lock
-
Lock file
-
/var/log
-
Log file
-
/var/opt
-
Information and data of the program in /opt
-
/var/run
-
Information about the program being executed, such as the PID file should be stored in this
-
/var/spool
-
Store the program's spool data (that is, spool)
-
/var/tmp
Temporary files
Resources:
http://linux-wiki.cn/wiki/zh-cn/Linux%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84
Http://www.enet.com.cn/article/2008/0102/A20080102982859.shtml
Http://hi.baidu.com/haifengjava/blog/item/b37d75af2a6546f3fbed5095.html
.
Linux directory Structure