In Learning computer knowledge, we know a lot of operating systems, common such as Windows,ios,android,linux,
With the depth of learning we are now starting the study of Linux, because it is not very familiar with this aspect, so we should start from the basis of learning.
First, the computer five large units
First of all to learn an operating system, we want to understand the approximate structure of the operating system, for the classic von Neumann architecture:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7F/FE/wKioL1c0Ac6RXmX8AAAyklrzIos492.png "title=" Qq20160512120438.png "alt=" Wkiol1c0ac6rxmx8aaayklrzios492.png "/>
The so-called storage is memory, and the input device includes keyboard, mouse, tablet, etc., output device including display, printer
And so on, the arithmetic is usually performed by the operator, and the controller generally performs the logical operation.
The general process of data operations: data input from the input device, into the memory, the CPU from the memory to be processed by the data,
Then perform the related operation, then put the processed data back into memory, and then display the data to the screen by the output device.
or print it out.
Second, environment variables
What is an environment variable?
Linux is a multi-user system, multi-user system means that each user login to the system, have their own unique environment, the environment is defined by a set of variables, and this set of variables become environment variables, this set of environment variables can be defined by the shell.
Common environment variables and their effects:
path: Current search Path
LOGNAME: Current host name
HOME: Specify the user's working directory
Shell: Specifies which shell is used by the current user
Lang/languge: Current language
PS: Command basic prompt, for root user is #, for normal user is $
PS2: Secondary prompt, default is ">"
MILA: Current mail storage directory
Note: The names of the above variables are not fixed, for example, HOSTNAME is set to hoest on some Linux systems
At the same time, Linux provides instructions for viewing and modifying environment variables, and several common directives and their functions are as follows:
1.echo: Displays the value of an environment variable
2.Export: Modify a new environment variable
3.Envy: Show all environment variables
4.Set: Displays variables defined by the local shell
5.unset: Clear an environment variable
6.readonly: Setting read-Only environment variables
Iii. Types of files
Normal file
① Plain Text Document (ASCII): The largest class of file types in a Linux system
② binary (binary): The executable file in the Linux system is in this format
③ data Format file: Some programs will read some files in a particular format during the run
Files are called data format files
2. Table of Contents (directory): The first character is [d]
3. Connection file: [l] divided into soft and hard connections
4. Equipment and Equipment files: ① block device files: [b] Some storage files, such as disks
② character device file: [C] interface files for some serial ports, such as mouse, printer, etc.
5. Socket (sockets): [S] is also known as the Data interface file, this type of file is generally used in the network of data link.
6. Pipeline file (pipe): [P] is a special type of file, which is mainly used to solve problems caused by multiple programs accessing the same file simultaneously.
Iv. extension of Linux
In fact, the Linux file does not have an extension, because for a Linux file, whether it can be executed depends on X, and the file name
It doesn't matter, we have to differentiate this feature from the extension under Windows, under Linux if your permissions have x, such as [-
Rwx-r-xr-x], then this file can be executed.
Although the extension does not work in Linux, we can add a letter with a similar extension to the file name so that it can be intuitively
To understand the file type, although this "extension" has no effect on the file.
In Linux everything is file.
The principle of Linux shell command operation
In Linux, the user is instructed to use the operating system, but the command does not direct the operating system, but through the shell to communicate instructions to the Department
And then feed the results back to the user through the shell.
So what exactly does the shell do?
Shell's technical definition: command interpreter
The main functions include:
Translate user-given instructions to system core processing
Translating the results of core processing to
How does the shell run the program?
The shell creates a new process by fork, and then runs the user-specified program through the EXECV function cluster in the new process, then the shell waits for the new process to end with the wait command, and the wait instruction call exits from the kernel and the signal sequence tells the subroutine how to end it.
This article is from the "Fu da xin" blog, please be sure to keep this source http://10800121.blog.51cto.com/10790121/1772934
Getting Started with Linux (i)