Linux directory structure decomposition and its meaning and recommendations

  • 2020-05-07 20:47:07
  • OfStack

/

root - one of the core files used to launch Linux. Such as operating system kernel, boot program Grub.
home - stores the personal files of ordinary users
  ftp - all user services
  httpd
  samba
  user1
  user2
bin - execution file required for system startup (base 2)
sbin - directory of executable programs, but mostly contains commands related to system administration. Only the root permission can be executed
proc -- virtual, linux kernel image exists; Save all kernel parameters and system configuration information
  1 -- process number
usr -- user directory for user level files
  bin - commands used by almost all users, in addition to /bin, /usr/local/bin
  sbin - system administrator commands that are relevant to users, for example, most server programs
  include --   is the directory where C/C++ header files are stored
  lib - fixed program data
  local - save location for locally installed software
  man - manually generated directories
  info -- information document
  doc - different package document information
  tmp
This directory holds all the files needed to run X-Window. This directory also contains configuration files and binary files for running GUI.
  X386-- system files with the same functions as X11R6, X11 release 5
boot - the file required for the boot loader, where the system images are saved
lib - a common library for programs and core modules in the root file system directory
  modules - loadable modules that can be restarted after a system crash
dev -- device file directory
etc -- configuration file
  skel -- the home directory is created and initialized
  sysconfig - network, time, keyboard, etc
var
  file
  lib - files in this directory change as the system runs
  local - installed in /usr/local program data, changed
  lock -- a file that USES a specific peripheral or file is locked and temporarily inaccessible to other files
  log -- logging
  run -- system operation legal information
  spool - spooling directories for printers, mail, proxy servers, etc
  tmp
  catman -- cache directory
mnt - temporary place to mount a file system. In general, this directory is empty, but when we are going to mount the partition, we will create a directory in this directory, and then mount the device we are going to access on this directory, so that we can access the files.
tmp -- temporary file directory. Temporary files after system startup are stored in /var/tmp
lost+found - files recovered during file system repair

Here are a few Suggestions for each directory that I hope will help you.

/ : root directory, 1 common root directory to store only directory, do not store files, /etc, /bin, /dev, /lib, /sbin and the root directory should be placed in a partition
/ bin: / usr/bin: 2 a binary executable file directory, such as commonly used commands ls, tar, mv, cat, etc.
/boot: place some of the files that were used when the linux system was started. /boot/vmlinuz is the kernel file for linux, and /boot/gurb. Separate partition is recommended for . The partition size is 100M
/dev: storage of linux system device files, access to a file in the directory, equivalent to access to a device, usually mounted optical drive mount /dev/cdrom /mnt.
etc: the directory where the system configuration files are stored. is not recommended to store the executable files . The important configuration files are /etc/inittab, /etc/fstab, /etc/ init.d, /etc/X11, /etc/sysconfig, /etc/ xinetd.d.
Note: /etc/X11 stores Settings related to x windows.
/home: the default home directory of the system. When the user account is newly added, the home directory of the user is stored in this directory. ~ represents the home directory of the current user, and ~test represents the home directory of the user test. recommends separate partitions and large disk space for easy storage
/ lib: / usr/lib: / usr/local/lib: use function library catalog system, procedure in the process of execution, the need to call 1 extra parameters, without the help of a library is more important directory to/lib modules.
/lost+fount: when a system exception produces an error, some missing fragments are placed in this directory. This directory usually appears automatically in the device directory. If the hard disk is loaded into /disk, the directory will automatically produce /disk/lost+found
/mnt:/media: the default mount point of the disc. Usually the disc is mounted under /mnt/cdrom.
/opt: the directory where the extra software is installed on the host. For example, the Fedora community development software used by FC4 can be installed in this directory if you want to install the new KDE desktop software by yourself. In the previous Linux system, the custom was placed under the /usr/local directory
/proc: the data in this directory is in memory, such as the system core, external devices, network state, because the data is stored in memory, so does not occupy disk space, the more important directory is /proc/cpuinfo, /proc/interrupts, /proc/dma, /proc/ioports, /proc/net/*
/root: the home directory of system administrator root. The first partition the system starts is /, so it is best to place /root and/under one partition.
/ sbin: / usr/sbin: / usr/local/sbin: place the executable command system administrators use, such as fdisk, shutdown, mount, etc. Unlike /bin, these directories are for the system administrator root to use, 1 general users can only "view" but not set and use.
/tmp: 1 a directory where users or executing programs temporarily store files, accessible to anyone, and where important data cannot be placed
/srv: the directory of data to be accessed after the service starts, such as the web page data to be accessed by the www service in /srv/www
/usr: applications store directories, /usr/bin store applications, /usr/share store Shared data, /usr/ share store library files that cannot be run directly, but are necessary for many programs to run. /usr/local: store software upgrade packages. / usr/share/doc: system document storage directory. / usr/share/man: program description file storage directory, use man ls will query/usr share/man man1 / ls. 1. gz suggested that separate partitions, the content of the larger set of disk space
/var: place the files that change frequently during the execution of the system, such as the constantly changing log files /var/log, /var/log/message: all logon files are stored in the directory, /var/spool/mail: mail directory, /var/run: PID is stored in the directory after the program or service is started. recommends a separate partition, with large disk space


A concise summary of directory structure names and meanings:

/bin this directory contains the common commands for Linux, in some versions the same directory as the root directory.
/boot this directory contains all the programs that will be used when the system is started. When you boot Linux with lilo, you will need some information here
This directory contains all the external devices used in the Linux system. It is actually the port to access these external devices. For example, if you type "cd /dev/cdrom" into the system, you can see the files in the optical drive. Type "cd /dev/mouse" to see the relevant files.
/cdrom this directory is empty when you first installed the system. You can hang the optical drive file system in this directory, for example, "mount /dev/cdrom /cdrom".
/etc this directory contains various configuration files and subdirectories for system administration, such as network configuration files, file systems, X system configuration files, device configuration information, Settings user information, etc.
/sbin this directory is used to store the hypervisors of system administrators.
If a user named "xx" is created, there is a corresponding "/home/xx" path in the /home directory to hold the user's home directory.
/lib this directory is used to hold system dynamically connected Shared libraries, which are used by almost all applications
/lost+found the directory is empty most of the time. But in the event of a power failure or an unusual shutdown, some files are temporarily stored here.
/mnt this directory is also empty in 1 case, you can temporarily hang other file systems in this directory.
/proc can get system information from this directory, which is generated by the system itself in memory
/root if you are logged in as a root user, this is the root user's home directory
/tmp is used to store temporary files generated during the execution of different programs
Many applications and files for /usr users reside in this directory


Related articles: