Ticker

6/recent/ticker-posts

Header Ads Widget

Linux system directory structure

After logging in to the system, enter the command in the current command window:
 Ls / 
You will see the following picture:


Tree directory structure:

The following is an explanation of these directories:
  • /bin : 
    bin is an abbreviation for Binary, which stores the most frequently used commands.
  • /boot:
    This is the core file used to start Linux, including some connection files and image files.
  • /dev :
    dev is an abbreviation of Device. The directory stores Linux external devices. The way to access devices in Linux is the same as accessing files.
  • /etc:
    This directory is used to store all the configuration files and subdirectories needed for system management.
  • /home : The 
    user's home directory. In Linux, each user has its own directory. Generally, the directory name is named after the user's account.
  • /lib : 
    This directory contains the most basic dynamic connection shared library of the system, which is similar to the DLL file in Windows. These shared libraries are needed for almost all applications.
  • /lost+found : 
    This directory is generally empty. When the system is shut down illegally, some files are stored here.
  • /media : The 
    linux system will automatically recognize some devices, such as U disk, CD-ROM, etc. After recognition, Linux will mount the identified device to this directory.
  • /mnt : 
    This directory is provided for users to temporarily mount other file systems. We can mount the CD-ROM drive on /mnt/ and then enter the directory to view the contents of the CD-ROM drive.
  • /opt : 
     This is the directory where the extra software is installed for the host. For example, if you install an ORACLE database, you can put it in this directory. The default is empty.
  • /proc : 
    This directory is a virtual directory, which is a mapping of system memory. We can access system information by directly accessing this directory. 
    The contents of this directory are not on the hard disk but in the memory. We can also modify some files directly. For example, you can use the following command to shield the host's ping command so that others cannot ping your machine:
    Echo 1 > /proc/ sys / net / ipv4 / icmp_echo_ignore_all  
  • /root : 
    This directory is the system administrator, also known as the superuser's user home directory.
  • /sbin : 
    s is the meaning of Super User. This is the system management program used by the system administrator.
  • /selinux : 
     This directory is a directory unique to Redhat/CentOS. Selinux is a security mechanism similar to Windows Firewall, but this mechanism is more complicated. This directory is for storing selinux related files.
  • /srv : 
     This directory stores some data that needs to be fetched after the service is started.
  • /sys :
     This is a big change in the linux2.6 kernel. A new file system, sysfs, in the 2.6 kernel is installed in this directory.
    The sysfs file system integrates information about the following three file systems: the proc file system for process information, the devfs file system for devices, and the devpts file system for pseudo-terminals.
    This file system is an intuitive reflection of the kernel device tree.
    When a kernel object is created, the corresponding files and directories are also created in the kernel object subsystem.
  • /tmp : 
    This directory is used to store some temporary files.
  • /usr : 
     This is a very important directory. Many of the user's applications and files are placed in this directory, similar to the program files directory under Windows.
  • /usr/bin:
    The application used by the system user.
  • /usr/sbin:
    A more advanced hypervisor and system daemon used by superusers.
  • /usr/src: The
    default placement directory for kernel source code.
  • /var : 
    This directory contains things that are constantly expanding. We are used to placing directories that are frequently modified in this directory. Includes various log files.
  • /run : 
    is a temporary file system that stores information since the system was started. When the system is restarted, the files in this directory should be deleted or cleared. If you have a /var/run directory on your system, you should point it to run.
In a Linux system, there are several directories that are important. You should always take care not to delete or change internal files at will.
/etc : As mentioned above, this is the configuration file in the system. If you change a file in this directory, the system may not start.
/bin, /sbin, /usr/bin, /usr/sbin : This is the directory where the system defaults the executable file. For example, ls is in the /bin/ls directory.
It is worth mentioning that /bin, /usr/bin is the instruction used by the system user (except the root user), and /sbin, /usr/sbin is the instruction used by root.
/var : This is a very important directory. There are a lot of programs running on the system. Then each program will have corresponding logs generated, and these logs will be recorded in this directory, specifically in the /var/log directory. The default placement of mail is also here.

Post a Comment

0 Comments