First knowledge of Linux

Source: Internet
Author: User
Tags arithmetic readable


650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0029.gif "alt=" J_0029.gif "/> computer has become an indispensable part of life, we surf the internet, A series of activities, such as checking data, tapping code, and so on, come from computers, but people may not care how the computer works when each action is performed.

First of all, the computer has five main units, namely:

Input unit (e.g. keyboard, mouse, scanner, etc.),

Memory (used to store the information entered by the input device),

Arithmetic (for the corresponding arithmetic operation),

Controller (for Control program execution),

Output unit (outputs information obtained by the outside world, such as printers, monitors, etc.)


Do you remember the von Neumann architecture?


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7F/D2/wKioL1cu_X-Tj-8MAACH-52NuKU334.jpg "title=" A45060936b6f30476697c102a6288eab.jpg "alt=" Wkiol1cu_x-tj-8maach-52nuku334.jpg "/>


It must be a bit boring for everyone to look at the picture, so give us an example here.

eg: you use QQ to send a message to your friends, when you hit the keyboard, this simple action starts, how to send your message to each other?


At this point, let's analyze what your input device is,---> keyboard , which is beyond doubt. when you finish typing the information you entered, it will store the information in memory , through the control of the controller , the information through the network transmission device to your friends, all for you, your output device for the network transmission device , and your friend's input device is from the remote , read the information into memory , and finally display on the monitor, then your friend's output device is the monitor .


Understand the computer, we talk about the computer operating system, in fact, our first computer is no operating system, the operating system is not with the birth of computers, it is in the use of computers, in order to meet demand, improve resource utilization, enhance computer system performance, with the development of computer technology , we often use the Windows operating system, is the most basic system software on the computer, any application software on the computer is running on the operating system. In addition to the Windows operating system, let's meet another multi-user multitasking and open source operating system,---->Linux.


To start with Linux, here are a few concepts to look at:

1. Environment Variables : Each user login to the system, have their own operating environment, the environment is composed of a set of variables, we call IT environment variables. We can also modify the environment variables by our own requirements. This is the time to use the shell command. So the question is, what is the shell? 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0059.gif "alt=" J_0059.gif "/>650" this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0059.gif "alt=" j_0059.gif "/> I'll introduce you later.


What are some of the environment variables?

①PATH Specifies the search path for the command.

Use the Echo $PATH to take the contents of the variable; export PATH = $PATH: Search for the path. You can then enter the Echo $PATH to see the changed environment variables.

②HOME Specifies the user's working directory.

Use the Echo $HOME to view the current working directory.

eg

[Email protected] ~]$ echo $HOME

/home/admin

③logname the login name of the current user.

Use the Echo $LOGNAME to see the login name.

eg

[Email protected] ~]$ echo $LOGNAME

Admin

④histsize the number of bars that the history command records.

⑤PS1 command basic prompt, such as Super User #, normal user is $.

Detection is a superuser or a normal user.

eg

[Email protected] ~]$ echo $PS 1

[\[email protected]\h \w]\$

⑥PS2 prompt, ' > '.

2.

Linux provides commands for modifying and viewing environment variables.

eg

1.echo uses echo, which is used to display environment variables.

2.export is used to modify environment variables.

3.ENV displays all the environment variables.

4.set shows the local shell variable.

5.unset eliminate environment variables. unset + the environment variable you want to eliminate.

6.readonly sets the read-only environment variable.


A simple command is more familiar.

Now look at the shell you just said, what is the shell?

The shell is a shell program, which is simply the medium between the operating system and the user. When a user sends a message that needs to be received by the operating system, the shell shell works, which is passed through the shell to the operating system and then returned to the user via the operating system. However, there is a problem here, the shell shell program is likely to risk, such as (you want to buy things need money, you will instruct your brother and sister to ask your parents for money, because your parents say you spend money and so on, will only say your brother and sister, but will not affect you, of course, It's also limited to your brother and sister not to tell your parents that it was you who ordered the case Oh. 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0057.gif "alt=" J_0057.gif "/>650" this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0057.gif "alt=" J_0057.gif "/>" In this example, the shell is equivalent to you, the Shell subroutine is equivalent to your brother and sister. So when passed to the shell shell, the shell also distributes the task to other subroutines, which is not affected by the operating system and the user.


3.Linux File types

(1) normal type : [-]

① Plain Text documents

② binary files

③ Data Format File

(2) Catalogue: [D]

(3) Link file [l]

(4) Equipment and equipment files

① block device file [b] (hard disk, floppy disk)

② character device file [C] (keyboard, mouse)

(5) socket [s]: Data interface file

(6) pipe [P]

EG1:

Drwxr-xr-x. 2 Admin admin 4096 May 6 02:27 Desktop

Drwxr-xr-x. 2 Admin admin 4096 May 6 02:27 Documents

Drwxr-xr-x. 2 Admin admin 4096 May 6 02:27 Downloads

Drwxr-xr-x. 2 Admin admin 4096 May 6 02:27 Music

Drwxr-xr-x. 2 Admin admin 4096 May 6 02:27 Pictures

Drwxr-xr-x. 2 Admin admin 4096 6 02:27 Public

Drwxr-xr-x. 2 Admin admin 4096 May 6 02:27 Templates

Drwxr-xr-x. 2 Admin admin 4096 May 6 02:27 Videos


Finally, the idea of all files in Linux is expounded. In the Windows operating system, there are hard disks, shortcuts, etc., in Linux are called files, without the so-called distinction.

Under Windows, there are various extensions to execute, and under Linux, as long as there is x permission, the file can be executed. As shown in the eg1 .

When it comes to authority, it's simply a matter of who does the thing. People and things are emphasized here.

(1) File visitor: Divided into three kinds. User, other person, group:

(2) File: (Read, Write, execute) in Linux, we divide it into three groups. Three for a group:

such as:drwxr-xr-x. 2 Admin admin 4096 May 6 02:27 Desktop

The first D represents the directory, rwx is the first group, which indicates that this file isreadable and writable,r-x is a second group, which indicates a readable and non-writable executable,r-x is a third group, Represents a readable, non-writable executable.


This is where the first section of Linux comes in. Welcome everyone to put forward valuable comments oh. 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0063.gif "alt=" J_0063.gif "/>650" this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0063.gif "alt=" J_0063.gif "/>








First knowledge of Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.