"Reprint" The directory structure of the Linux file system

Source: Internet
Author: User

  • The commands required by the/bin base system are located in this directory and are required by the smallest system, such as LS, CP, mkdir, and so on, functions and/usr/bin are similar, the files in this directory are executable, commands that ordinary users can use. The most basic command required to be a basic system is to put it here.
  • The boot/boot Linux kernel and the files required for booting system programs, such as the Vmlinuz initrd.img files, are located in this directory. In general, the GRUB or LILO system Boot Manager is also located in this directory;
  • /dev Device file storage directory, such as sound card, disk ...
  • /etc System configuration file location, some server configuration files are also here, such as user account and password configuration file;
  • /home directory is the default directory for ordinary users;
  • /lib Library File storage Directory
  • /lost+found in the ext2 or ext3 file system, when the system crashes unexpectedly or the machine shuts down unexpectedly, some file fragments are placed here. When the system starts, the Fsck tool checks here and repairs the corrupted file system. Sometimes problems with the system, a lot of files are moved to this directory, may be repaired in a manual way, or moved to the original location of the file.
  • /media plug-and-play storage device mount point is automatically created in this directory, such as the USB disk system automatically mounts, will be in this directory to generate a directory, Cdrom/dvd automatically mount, will also create a directory in this directory, similar to CDROM directory. This is only available on the latest release kits, such as Fedora Core 4.0 5.0. Can see the definition of/etc/fstab;
  • /misc
  • /mnt This directory is typically used to store mounted storage devices, such as CDROM directory. You can see the definition of/etc/fstab. Sometimes we can put the system boot automatically mount file system, put the mount point here is also possible. The main view is how to define the/etc/fstab, such as CD-ROM can be mounted to the/mnt/cdrom.
  • /OPT represents the optional meaning, and some packages are also installed here, which is the custom package, such as in Fedora Core 5.0, where OpenOffice is installed. Some of the packages we compile ourselves can be installed in this directory, and the software installed through the source package can be used through the./configure--prefix=/opt/directory.
  • When the/proc operating system is running, the process (running program) information and kernel information (such as CPU, hard disk partition, memory information, etc.) are stored here. /proc directory masquerading file system proc mount directory, Proc is not a real file system, its definition can be see/etc/fstab.
  • /root the home directory for Linux super User root;
  • /sbin most of the commands involved in system Management, is the super-user root executable command storage, ordinary users do not have permission to execute the command under this directory, this directory and/usr/sbin;/usr/x11r6/sbin or/usr/local/ The Sbin directory is similar; we'll remember that all the directories sbin contain are root permissions to execute.
  • /tmp Temporary file directory, sometimes when users run the program, will produce temporary files. /tmp is used to store temporary files. The/var/tmp directory is similar to this directory.
  • /usr This is a directory of system storage programs, such as commands, help files, and so on. There are a lot of files and directories under this directory. When we install a Linux distribution that is officially provided by the package, it is mostly installed here. If a server configuration file is involved, the configuration file is installed in the/etc directory. The/usr directory includes the font directory/usr/share/fonts, help directory/usr/share/man or/usr/share/doc, normal user executable file directory/usr/bin or/usr/local/bin or/usr/ X11r6/bin, the super-user root executable command to store directories, such as/usr/sbin or/usr/x11r6/sbin or/usr/local/sbin, and the program's header file to store the directory/usr/include.
  • /var The content of this directory is constantly changing, see the name to know, we can understand as vary abbreviation,/var under/var/log This is used to store the system log directory. /var/www directory is to define the Apache server site storage directory,/var/lib used to store some library files, such as MySQL, as well as the storage of MySQL database;

Let us add some more important directories to use;

      • /ETC/INIT.D This directory is used to store scripts that the system or server starts in System V mode, which is common in systems that are started or initialized in the mode v. such as Fedora/redhat;
      • /ETC/XINIT.D if the server is running in xinetd mode, its script will be placed in this directory. Some systems do not have this directory, such as Slackware, and some older versions do not. In Rehat/fedora, a newer version exists in the comparison.
      • /ETC/RC.D This is a directory of the Slackware distribution, which is the location of the BSD startup script, such as defining the NIC, the server opening script, etc.
      • /ETC/X11 is the location of x-windows related configuration files;

For example, the following:

[[email protected] ~]#/etc/init.d/sshd start Note: Start the sshd server

[[email protected] ~]#/etc/init.d/sshd Stop Note: Stop the SSHD server

Start sshd: [OK]

This is the typical sshd server System V-mode startup script, which runs this script to start the sshd server.

    • /usr/bin This directory is a directory of executable programs, the normal user has permission to execute, when we install a program from the system's own package, most of his executable files will be placed in this directory. such as when installing the Gaim software package. Similar directories are/usr/local/bin; sometimes files in/usr/bin are/usr/local/bin linked files;
    • /usr/sbin This directory is also a directory of executable programs, but mostly contains commands that involve system administration. Only root privileges can be performed; similar directories are/sbin or/usr/local/sbin or/usr/x11r6/sbin, etc.;
    • /usr/local This directory is generally used to store the user self-compiled installation software storage directory, usually through the source package installed software, if not specifically designated installation directory, is generally installed in this directory. There are subdirectories under this directory. Check it out for yourself.
    • /usr/lib and/lib directory is similar, is the library file storage directory;
    • /usr/share System common store of things, such as/usr/share/fonts is a font directory, users are common.
    • /usr/share/doc and/usr/share/man Help file, is also common use it;
    • /USR/SRC is the kernel source directory, such as the following kernel source directory, such as Linux, linux-2.xxx.xx directory. Some systems will also install the source software package here. For example Fedora/redhat, when we install FILE.SRC.RPM, these packages will be installed in the corresponding directory/usr/src/redhat. In addition Fedhat 4.0 5.0, the directory of his kernel source package is located in a directory under the/usr/src/kernels directory (only after the installation will generate the corresponding directory);
    • /var/adm such as package installation information, logs, management information, etc., in the Slackware operating system has this directory. It doesn't seem to be in fedora, so take a look.
    • /var/log System log storage, analysis log to see this directory of things;
    • /var/spool printer, mail, proxy server, such as spool directory;

"Reprint" The directory structure of the Linux file system

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.