[1] The basic directory structure of the Linux system

If no error is prompted in linux, the operation is successful

Linux system

Power on login

Open opportunities to start many programs. They are called "services" in Windows and "daemons" in Linux.

After the boot is successful, it will display a text login interface. This interface is the login interface we often see. In this login interface, the user will be prompted to enter a user name, and the user entered by the user will be passed as a parameter to the login program to verify the user The password is not displayed, just press Enter after entering!

Generally speaking, there are three ways for users to log in:

  • Command line login
  • ssh login
  • Graphical interface login

The highest authority account is root, which can operate everything!

Shutdown

It is mostly used on servers in the linux field, and it rarely encounters shutdown operations. After all, there is no end to running a service on the server, unless under special circumstances, it will shut down as a last resort.

The shutdown command is: shutdown;

sync # 将数据由内存同步到硬盘中。

shutdown # 关机指令,你可以man shutdown 来看一下帮助文档。例如你可以运行如下命令关机:

shutdown –h 10 # 这个命令告诉大家,计算机将在10分钟后关机

shutdown –h now # 立马关机

shutdown –h 20:25 # 系统会在今天20:25关机

shutdown –h +10 # 十分钟后关机

shutdown –r now # 系统立马重启

shutdown –r +10 # 系统十分钟后重启

reboot # 就是重启,等同于 shutdown –r now

halt # 关闭系统,等同于shutdown –h now 和 poweroff

Finally, to summarize, whether you are restarting the system or shutting down the system, you must first run the sync command to write the data in the memory to the disk.

System directory structure

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

ls /

You will see as shown below:
Insert picture description here

Tree-like directory structure: (All Linux resources are mounted under this / root node)

Insert picture description here

The following is an explanation of these directories:

  • /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. (do not move)
  • /dev: dev is the abbreviation of Device, which stores the external devices of Linux. The way of accessing the device in Linux is the same as that of accessing files.
  • /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 its own directory. Generally, the directory name is named after the user's account. (Equivalent to the user directory in the c drive in windows, you can create a specific user directory in this directory)
  • /lib : This directory stores the most basic dynamic link shared libraries of the system, and its function is similar to DLL files in Windows. (do not move)
  • /lost+found : This directory is generally empty. When the system is shut down illegally, some files are stored here. (Store some files that suddenly shut down)
  • /media : 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. (Some local files will be mounted in this directory later)
  • /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.
  • /root : This directory is the home directory of the system administrator, also known as the user of the super authority.
  • /sbin : s stands for Super User. The system management program used by the system administrator is stored here.
  • /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.
  • /tmp : This directory is used to store some temporary files. Files that are lost after use can be placed in this directory to install the package!
  • /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 accustomed to placing those frequently modified directories in this directory. Including various log files.
  • /run : is a temporary file system that stores information since the system was started. When the system restarts, the files in this directory should be deleted or cleared.
  • /www : Store the resources, environment and website items related to the server website

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_43215322/article/details/113100216