Linux basics--directory introduction

Differences between Windows and Linux file systems

Under the Windows platform, open "Computer", we see a drive letter one by one:

Each drive has its own root directory structure, which results in multiple trees side by side, as shown: 

 

Under Linux, we don't see these drive letters, we see folders (directories):

 

 This is the folder displayed after clicking on the computer. You can see / is displayed in the top navigation bar. This is the root directory under linux. At this point, we may not know what this is. Don't worry, let's take a look. Linux directory structure diagram

The above directory structure diagram, if you turn it 180° and see if / is like a tree, and /bin, /usr... think about its branches, let's take a look at the role of each directory under linux.

  • /: The root directory. Generally, only directories are stored in the root directory. In Linux, there is one and only one root directory. Everything starts here. When you type "/home" in the terminal, you are actually telling the computer to start with / (the root directory) and then go to the home directory.
  • /bin, /usr/bin: Directory of executable binary files, such as commonly used commands ls, tar, mv, cat, etc.
  • /boot: Place some files used when the Linux system starts, such as the Linux kernel file: /boot/vmlinuz, and the system boot manager: /boot/grub.
  • /dev: Stores the device files under the Linux system. Accessing a file in this directory is equivalent to accessing a device. The commonly used method is to mount the CD-ROM drive mount /dev/cdrom /mnt.
  • /etc: The directory where the system configuration files are stored. It is not recommended to store executable files in this directory. Important configuration files are /etc/inittab, /etc/fstab, /etc/init.d, /etc/X11, /etc /sysconfig, /etc/xinetd.d.
  • /home: The default user home directory of the system. When adding a user account, the user's home directory is stored in this directory. ~ represents the current user's home directory, and ~edu represents the user's edu home directory.
  • /lib, /usr/lib, /usr/local/lib: The directory of the function library used by the system. During the execution of the program, the assistance of the function library is required to call some additional parameters.
  • /lost+fount: When an error occurs due to a system exception, some lost fragments will be placed in this directory.
  • /mnt: /media: The default mount point of the CD, usually the CD is mounted under /mnt/cdrom, but not necessarily, you can choose any location to mount it.
  • /opt: The directory where additional software is installed on the host.
  • /proc: The data in this directory is in the memory, such as the system core, external devices, and network status. Since the data is stored in the memory, it does not occupy disk space. The more important directories are /proc/cpuinfo, /proc/interrupts , /proc/dma, /proc/ioports, /proc/net/*, etc.
  • /root: The home directory of the system administrator root.
  • /sbin, /usr/sbin, /usr/local/sbin: Place executable commands used by system administrators, such as fdisk, shutdown, mount, etc. Different from /bin, these directories are commands used by the system administrator root, and ordinary users can only "view" but not set and use.
  • /tmp: A directory where files are temporarily stored by general users or programs being executed, and can be accessed by anyone. Important data cannot be placed in this directory.
  • /srv: The data directory that needs to be accessed after the service is started. For example, the web page data that the www service needs to access is stored in /srv/www.
  • /usr: Application storage directory, /usr/bin stores application programs, /usr/share stores shared data, /usr/lib stores some function library files that cannot be directly run, but are necessary for many programs to run. /usr/local: Stores software upgrade packages. /usr/share/doc: The directory where the system description files are stored. /usr/share/man: The directory where the program description files are stored.
  • /var: place files that change frequently during the execution of the system, such as log files that change at any time /var/log, /var/log/message: the directory where all log files are stored, /var/spool/mail: the directory where mail is stored, /var/run: After the program or service is started, its PID is stored in this directory.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324836569&siteId=291194637