All-stack essential Linux Basics
Linux is almost everywhere. Whether it is server construction or client development, the basic skills of the operating system are essential for the entire stack.
System Selection
Linux Release versions can be divided into two categories: one is the release version maintained by commercial companies and the other is the release version maintained by community organizations. The former is represented by the famous Redhat (RHEL, the latter is represented by Debian.
Redhat, which should be called the Redhat series, includes RHEL, Fedora, and CentOS (RHEL community clone version, free of charge ). Ubuntu is strictly not an independent release version. Ubuntu is based on Debian enhancement. It has all the advantages of Debian and almost perfect Linux desktop system with its own enhanced advantages. The Ubuntu community believes that practicality and innovation are superior to everything else.
If you need a stable server system, the best choice is CentOS. After installation is complete, simple configuration can provide very stable services. However, for the cloud environment, unbantu may be good. hadoop was first developed on ubantu.
Architecture
Understanding the architecture can have a good sense of direction. Linux has two modes: kernel and user. The kernel, shell, and file system form a basic operating system structure. The Linux kernel consists of the following parts: memory management, process management, device drivers, file systems, and network management.
Linux Kernel
Understand the Linux kernel, make full use of resources, and have a sense of purpose during system optimization.
Linux divides memory into easy-to-process "memory pages" and provides an abstraction of the 4 KB buffer zone, such as the slab distributor. A process is actually a running entity of a specific application. Process Scheduling controls the process's access to the CPU. Common inter-process communication mechanisms in Linux include signals, pipelines, shared memory, semaphores, and sockets. The kernel provides an API through SCI to create a new process (fork, exec, or pos ix), stop the process (kill, exit ), and Communication and synchronization between them (signal or pos ix mechanism ).
The Linux operating system combines an independent file system into a hierarchical tree structure, which is represented by a separate object. Linux supports many different file systems and organizes them into a unified Virtual File System. the Device Driver provides a set of abstract interfaces that can be understood by the operating system to complete and interact with the operating system. The specific operation details related to the hardware are completed by the device driver. The Network part of the Linux kernel is composed of BSD socket, network protocol layer, and network device driver. Network Device Drivers communicate with hardware devices. Each possible hardware device has a corresponding device driver.
Linux File System
Linux supports a variety of popular file systems, and EXT4 is recommended.
The file types in Linux are as follows:
1) common files are divided into plain text and binary files.
2) Directory files, where files are stored.
3) link files to files in the same file or directory.
4) device files are divided into Block devices and character devices.
5) MPs queue files to provide inter-process communication
6) socket files related to network communication
Linux uses the standard directory structure, and the installer has created a file system and a complete and fixed directory structure for the user, specifying the role of each directory and the file type.
| Directory Name |
Brief Description |
|
/Bin |
Binary executable command |
|
/Dev |
Special Device Files |
|
/Etc |
System Management and configuration files |
|
/Etc/rc. d |
STARTUP configuration file and script |
|
/Home |
The base point of the user's main directory. For example, if the user abc's main directory is/home/user, you can use ~ Abc |
|
/Lib |
Standard programming library |
|
/Sbin |
The system management command stores the management program used by the system administrator. |
|
/Tmp |
Public temporary file storage points |
|
/Root |
Main directory of the system administrator |
|
/Mnt |
The system provides this directory to allow users to temporarily Mount other file systems. |
|
/Lost + found |
This directory is usually empty, and the system shuts down abnormally, leaving "Homeless" files |
|
/Proc |
A virtual directory is the ing of system memory. You can directly access this directory to obtain system information. |
|
/Var |
Overflow of some large files, such as log files of various services |
|
/Usr |
Almost all the applications and files used in the largest directory are in this directory. Including:
/Usr/X11R6 directory for storing X Windows
/Usr/bin numerous applications
/Usr/sbin hyperuser Management Program
/Usr/doc linux document
Header files required for developing and compiling applications in/usr/include linux
/Usr/lib common dynamic link library and software package configuration file
/Usr/man help document
/Usr/src Source Code. The linux kernel source code is stored in/usr/src/linux.
/Usr/local/bin commands added locally
/Usr/local/lib: locally added Library |
Shell is a system user interface that provides an interface for users to interact with the kernel. It receives user-input commands and sends them to the kernel for execution. It is a command interpreter. Shell has many types. BASH is recommended here. BASH is the GNU Bourne Again Shell, which is the default shell on the GNU operating system. Most linux distributions use this shell. Linux Shell and commands
There are many Linux commands, and a simple classification is given below.
Organize linux commands in shell to complete a series of tasks, that is, shell programming. Shell, Perl, and Python are the most common scripting languages in Linux. I recommend using Python.
Linux applications
Standard Linux systems generally have a set of assemblies called applications, including text editors, programming languages, X Windows, Internet tools, and databases.
For text editing, Emacs and vim have their own merits and can be used as IDE through plug-ins. In my personal sense, VIM should also be a required skill. There are also a lot of vim commands, which are organized as follows:
For application management, ubuntu needs to be familiar with apt commands, while centos is the yum command. Of course, it is necessary to compile and install the source code. The makefile writing method, configure/autoconfig/make, must be handy.
Source: zhihu
Link: www.zhihu.com/question/31034164/
The free course for Linux cloud computing started in January,5 days freeO & M dry goods content free of charge,Click the end of the article"Read original"Free O & M courses!Speed to grab ~~~~
PS: Check out the free gift package provided by xiaobian ~
Benefits | more than 10 thousand sets of PPT templates for free! Unconditional receipt!
Free | more than 1000 sets of resume templates are offered free of charge, and a resume creation tutorial is provided!
Free of charge | the "Shell script 100 cases" ebook is free of charge and must be used for O & M ~
Click 【Read original], Free to listen to five days of Linux O & M Dry Goods sharing courses, hot discussion, come to grab!