1. Overview of Linux

The Linux kernel was originally written by Linus Torvalds, a Finn, as a hobby while studying at the University of Helsinki.

Linux is a free to use and freely spread Unix-like operating system. It is a POSIX and UNIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system.

Linux can run major UNIX tools, applications, and network protocols. It supports both 32-bit and 64-bit hardware. Linux is a stable multi-user network operating system, which inherits the network core design idea of Unix.

Linux official website: www.linux.org/

The difference between Linux and Windows

At present, the domestic Linux is more applied to the server, and the desktop operating system is more used in Windows. The main differences are as follows:

2. Power off and start up

In the Linux world, it’s mostly on the server, and shutdown operations are rarely encountered. After all, there is no end to running a service on the server, except in special circumstances, will be shut down.

Shutdown command: shutdown

Whether you restart or shut down the system, you first run sync to write data from memory to disk.

3. System directory structure

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

 ls / 
Copy the code

You’ll see something like this:

Tree directory structure:

Here is an explanation of these categories:

  • /bin: Bin is short for Binaries, and this directory holds the most frequently used commands.

  • /boot: This contains some of the core files used to start Linux, including connection files and image files.

  • /dev: dev is short for Device. This directory contains external devices for Linux. In Linux, devices are accessed in the same way as files.

  • ==/etc: etc is short for Etcetera, this directory is used to store all the configuration files and subdirectories required for system administration. = =

  • ==/home: the user’s home directory. In Linux, each user has its own directory, usually named after the user’s account, such as Alice, Bob, and Eve in the figure above. = =

  • /lib: lib is short for Library. This directory contains the system’s most basic dynamically connected shared libraries, which act like DLL files on Windows. Almost all applications need these shared libraries.

  • /lost+found: This directory is usually empty. When the system is shut down illegally, this is where some files are stored.

  • /media: The Linux system automatically identifies some devices, such as USB flash drives and cd-rom drives, and then mounts the identified devices to this directory.

  • / MNT: The system provides this directory for users to temporarily mount other file systems, we can mount the CD/DVD-ROM drive in/MNT /, and then enter the directory can view the contents of the CD/DVD-ROM drive.

  • ==/opt: Opt is short for Optional. This is the directory where you can install additional software on your host. For example, if you install a MYSQL database, you can put it in this directory. The default is empty. = =

  • /proc: This directory is a virtual directory. It is a map of system memory. We can access this directory directly to obtain system information.

  • ==/root: This directory is the home directory of the system administrator, also known as the super user. = =

  • /sbin: s stands for Super User and is short for Superuser Binaries. This is the repository for the hypervisor used by the system administrator.

  • /selinux: this directory is unique to Redhat/CentOS. Selinux is a security mechanism similar to the Windows firewall, but it is more complex. This directory is used to store selinux related files.

  • / SRV: This directory holds some data that needs to be extracted after the service starts.

  • / sys:

    This is a big change for the Linux2.6 kernel. A new file system, sysFS, is installed in the 2.6 kernel.

    The SYSFS file system integrates information for 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.

    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: TMP is short for temporary this directory is used to store temporary files. = =

  • ==/usr: usr stands for Unix Shared Resources. This is a very important directory where many of a user’s applications and files are stored, similar to the Program Files directory on Windows. = =

  • /usr/bin: applications used by system users.

  • /usr/sbin: the more advanced hypervisor and system daemon used by the superuser.

  • /usr/src: the default directory where the kernel source code is placed.

  • ==/var: var is short for variable. This is the directory where things are constantly expanding. We use this directory to keep directories that are often changed. Includes various log files. = =

  • /run: is a temporary file system that stores information since the system started. Files in this directory should be deleted or erased when the system restarts. If you have a /var/run directory on your system, you should make it point to run.

  • = = / WWW: = =

    == Stores resources related to the server website, such as environment, project, etc. This parameter is available only on the server. The local VM does not have ==