Explanation of folders in Linux

Source: Internet
Author: User

For Linux, the organizational structure of files varies depending on different versions, but the main folders should be the same. Understanding the meaning of these folders is of great significance for understanding Linux.

1. The/Linux File System entry is also the directory at the highest level;
2. The commands required by the/bin system are located in this directory, such as ls, cp, and mkdir. The functions are similar to those of/usr/bin, all files in this directory are executable and can be used by common users. The most basic command required by the basic system is put here.

3. The directory of the boot Linux kernel and the files required by the boot system program, such as the vmlinuz initrd. img file, are located in this directory. In general, GRUB or LILO System Boot manager is also located in this directory.
4./dev device file storage directory, such as sound card and disk ......
5. The location of the/etc system configuration file. Some server configuration files are also located here, such as the user account and password configuration files.
6. The/home ordinary user's home directory is stored by default;
7./lib library file storage directory
8./lost + found in the ext2 or ext3 file system, some file fragments are generated here when the system crashes or the machine shuts down unexpectedly. When the system is started, The fsck tool checks this and fixes the damaged file system. Sometimes a system problem occurs. Many files are moved to this directory and may be repaired manually or moved to the original location.
9. The/mnt directory is generally used to store the mounted directory of the mounted storage device, such as the cdrom directory. See the definition of/etc/fstab. Sometimes we can enable the system to automatically mount the file system at startup and put the mount point here. It mainly depends on the definition in/etc/fstab. For example, the optical drive can be mounted to/mnt/cdrom.
10. opt indicates the optional meaning. Some software packages will also be installed here, that is, custom software packages. For example, in Fedora Core 5.0, OpenOffice is installed here. Some software packages compiled by ourselves can be installed in this directory. The software installed through the source package can be installed through the./configure -- prefix =/opt/directory.

11. The process information and kernel information (such as cpu, hard disk partition, and memory information) are stored here when the proc operating system is running. The/proc directory is the mounted directory of the file system proc disguised. proc is not a real file system. For its definition, see/etc/fstab.
12./root Linux root's home directory;
13. Most of the/sbin commands related to system management are stored, which is the place where super-privileged users root executable commands are stored. ordinary users do not have the permission to execute commands in this directory, this directory is similar to/usr/sbin;/usr/X11R6/sbin or/usr/local/sbin. Just remember it, all contents contained in sbin can be executed only with the root permission.
14./tmp temporary file directory. Sometimes the user will generate temporary files when running the program. /Tmp is used to store temporary files. The/var/tmp directory is similar to this directory.
15./usr is the directory where the system stores programs, such as commands and help files. This directory contains many files and directories. Most of the software packages officially provided by the Linux release are installed here. If a server configuration file is involved, the configuration file will be installed in the/etc directory. The/usr directory contains the/usr/share/fonts directory, the help directory/usr/share/man or/usr/share/doc, A common user can execute the file directory/usr/bin or/usr/local/bin or/usr/X11R6/bin. The root executable command can be stored in the directory, for example
/Usr/sbin or/usr/X11R6/sbin or/usr/local/sbin, And the header file directory of the Program/usr/include.
16. The contents of the var directory are changed frequently. We can see the name as the abbreviation of vary, /var has/var/log, which is the directory used to store system logs. The/var/www directory defines the directory where the Apache server site is stored;/var/lib is used to store some library files, such as MySQL and the location where the MySQL database is stored;

Below are some important sub-Directories
1. the/etc/init. d directory is used to store the scripts started by the System or server in System V mode, which is common in Systems started or initialized in System V mode. For example, Fedora/RedHat;
2. If the server runs in xinetd mode, put the script in this directory. Some systems do not have this directory, such as Slackware, and some old versions do not. In Rehat/Fedora, a new version is compared.
3./etc/rc. d is a directory of the Slackware release, where the bsd startup script is stored, such as defining the NIC and enabling the script on the server.
4./etc/X11 is the location for storing configuration files related to X-Windows.
5. the/usr/bin directory is the directory of executable programs. Normal users have the permission to execute the program. When we install a program from the software package that comes with the system, most of his executable files are stored in this directory. For example, when installing the gaim software package. A similar directory is/usr/local/bin. Sometimes the file in/usr/bin is a link file of/usr/local/bin;
6. the/usr/sbin directory is also the directory of executable programs, but most of them store commands related to system management. Only the root permission can be executed. Similar directories are/sbin or/usr/local/sbin or/usr/X11R6/sbin.
7. the/usr/local directory is generally used to store the user's self-compiled and installed software. Generally, the software is installed through the source code package. If the installation directory is not specified, it is usually installed in this directory. This directory contains subdirectories. Let's take a look.
8. the/usr/share system stores shared items. For example,/usr/share/fonts is a font directory,/usr/share/doc, and/usr/share/man help file.

9,/usr/src is the directory of the kernel source code storage, such as the following kernel source code directory, such as linux, linux-2.xxx.xx directory. Some systems also install the source code package here. For example, Fedora/Redhat. When we install file. src. rpm, these packages will be installed in the corresponding directory of/usr/src/redhat.

10. The system header file required for/usr/include application development. Many important C/C ++ header files are stored here, such as stdio. h.
Unistd. h.
11. The system library files required for/usr/lib application development. Many important C/C ++ library files are stored here, such as libstdc ++,
C.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.