Linux learning summary (1) files and directories

Linux system directory structure

After logging in to the system, enter the command in the current command window:

 ls / 

You will see the following figure:
Insert picture description here
Tree-like directory structure: The
Insert picture description here
following is an explanation of these directories:

  • 1./bin:
    bin is the abbreviation of Binary, this directory stores the most frequently used commands.
  • /boot:
    Stored here are some core files used when starting Linux, including some connection files and mirror files.
  • /dev:
    dev is the abbreviation of Device (device), Linux external devices are stored in this directory, and the way of accessing devices and files in Linux is the same.
  • /etc:
    This directory is used to store all configuration files and subdirectories required for system management.

  • /home: The
    user's home directory. In Linux, each user has his own directory. Generally, the directory name is named after the user's account.

  • /lib:
    This directory stores the most basic dynamic link shared libraries of the system, and its function is similar to the DLL files in Windows. Almost all applications need to use these shared libraries.

  • /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 recognized device to this directory.

  • /mnt: The
    system provides this directory to allow 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 additional software is installed on 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 directly access this directory to obtain system information.
    The content of this directory is not on the hard disk but in the memory. We can also directly modify some files in it. For example, you can use the following command to block 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 user's home directory of the system administrator, also known as the super authority.

  • /sbin:
    s means Super User, and the system management program used by the system administrator is stored here.

  • /selinux:
    This directory is unique to Redhat/CentOS. Selinux is a security mechanism, similar to a 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 extracted 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 the following three types of file system information: the proc file system for process information, the devfs file system for devices, and the devpts file system for pseudo-terminals.
    The 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 user applications and files are placed in this directory, similar to the program files directory under windows.

  • /usr/bin:
    Application programs used by system users.

  • /usr/sbin:
    The more advanced management programs and system daemons used by super users.

  • /usr/src: The default storage directory for the kernel source code.

  • /var:
    This directory contains things that are constantly expanding. We are used to putting those frequently modified directories under this directory. Including various log files.

In the Linux system, there are several directories that are more important, and you need to be careful not to delete or change internal files by mistake.

  • /etc: As
    mentioned above, this is a 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 default storage directory of the executable file. For example, ls is in the /bin/ls directory.

It is worth mentioning that /bin, /usr/bin are instructions for system users (pass users except root), and /sbin, /usr/sbin are instructions for root.

  • /var: This is a very important directory. There are many 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, in addition The default placement of mail is also here.

ls -l means

Insert picture description here

gt@ubuntu:~$ stands for meaning

gt: the currently logged-in user
@: means at in English, in
ubuntu: hostname
~: the location of the current working directory, the host directory
$: indicates that the currently logged-in user is a normal user
#: indicates the root user

Guess you like

Origin blog.csdn.net/bureau123/article/details/111728817