Linux system selection, architecture and application details

Linux is almost everywhere, whether it's server build or client development, the basic skills of the operating system are essential for the full stack.

System selection

Linux distributions can be broadly divided into two categories, one is the distribution version maintained by the commercial company, and the other is the distribution version maintained by the community organization. The former is represented by the famous Redhat (RHEL), and the latter is represented by Debian.

Redhat, should be called the Redhat series, including RHEL, Fedora, CentOS (RHEL community clone version, free). Ubuntu is not strictly a stand-alone distribution. Ubuntu is based on Debian enhancements, a near-perfect Linux desktop system with all the advantages of Debian and the advantages it has. The Ubuntu community believes that practicality and innovation are above everything else.

If you need a more stable server system, then the best choice is CentOS. After the installation is complete, you can provide very stable services through simple configuration. But for the cloud environment, unbantu may be good, hadoop was first developed on ubantu.

Architecture

Understanding the architecture can have a better sense of direction. Linux has two modes: kernel and user. The kernel, shell and file system form the basic operating system structure. The Linux kernel consists of the following parts: memory management, process management, device driver, file system and network management.

Linux kernel

Understand the Linux kernel, you can make full use of resources, and have a sense of purpose when tuning the system.

Linux divides memory into "memory pages" that are easy to handle, providing an abstraction of 4KB buffers, such as the slab allocator. A process is actually a running entity of a particular application, and the process schedule controls the access of the process to the CPU. Common interprocess communication mechanisms in Linux are signals, pipes, shared memory, semaphores, and sockets. The kernel provides an API through SCI to create a new process (fork, exec, or POSIX), stop processes (kill, exit), and communicate and synchronize between them (signal or POSIX mechanism).

The Linux operating system combines separate file systems into a hierarchical tree structure with a single entity representing the file system. Because Linux supports many different file systems and organizes them into a unified virtual file system. Device drivers provide a set of operating system understandable abstract interfaces to complete interactions with the operating system, while hardware-specific The operational details are done by the device driver. The network portion of the Linux kernel consists of BSD sockets, network protocol layers, and network device drivers. The network device driver is responsible for communicating with the hardware device, and each possible hardware device has a corresponding device driver.

Linux file system

Linux systems can support a variety of popular file systems, and EXT4 is recommended.

The file types below Linux mainly include:

1) Ordinary files, divided into plain text and binary.

2) Directory files, where files are stored.

3) Link files, files that point to the same file or directory.

4) Device files, which are divided into block devices and character devices.

5) Pipeline files that provide interprocess communication

6) Socket file, related to network communication

Linux uses a standard directory structure, and the installer has created a file system and a complete and fixed directory for the user, specifying the role of each directory and the file types in it.

Directory name
/bin Binary executable command
/dev Device special file
/etc System management and configuration files
/etc/rc.d Launched configuration files and scripts
/home The base point of the user's home directory, such as the home directory of the user abc, is /home/user, which can be represented by ~abc
/lib Standard programming library
/sbin System management command, here is the management program used by the system administrator
/tmp Public temporary file storage point
/root System administrator's home directory
/mnt This directory is provided by the system to allow users to temporarily mount other file systems.
/lost+found This directory is usually empty, the system is not properly shut down and leaves a "homeless" file.
/proc A virtual directory is a mapping of system memory. You can access this directory directly to get system information.
/var The overflow area of ​​some large files, such as the log files of various services
/usr The most extensive directories, the applications and files to be used are almost all in this directory. Which contains: /usr/X11R6 The directory where the X window is stored /usr/bin Many applications /usr/sbin Some supervisors of the superuser /usr/doc linux documentation /usr/include Required for developing and compiling applications under linux Header file /usr/lib Commonly used dynamic link library and package configuration file /usr/man help documentation /usr/src source code, linux kernel source code is placed in /usr/src/linux /usr/local/ Bin locally added command /usr/local/lib locally added library

The shell is the user interface of the system and provides an interface for users to interact with the kernel. It receives the command entered by the user and sends it to the kernel for execution. It is a command interpreter. There are many types of shells, and BASH is recommended here. BASH is GNU's Bourne Again Shell, the default shell on the GNU operating system. Most Linux distributions use this shell. Linux shell and commands

There are many commands for Linux, and a simple classification is given below.

Organizing linux commands in the shell to accomplish a series of tasks is shell programming. Shell, Perl, and Python are the most commonly used scripting languages ​​on Linux, and I recommend using Python.

Linux application

Standard Linux systems generally have a set of assemblies called applications that include text editors, programming languages, X Window, Internet tools, and databases.

For text editing, Emacs and vim have their own advantages, and can even be used as an IDE through plug-ins. Personally, VIM should also be a must. There are also a lot of vim commands, organized as follows:

As far as application management is concerned, ubuntu needs to be familiar with the apt command, and centos is the yum command. Of course, source code compilation and installation is a must, the makefile, the use of configure/autoconfig/make must be handy.

Computer Power Supply

Easy Electronic Technology Co.,Ltd , https://www.yxpcelectronicgroups.com

Posted on