Detail the simple commands in three modes of Linux system

  • 2020-09-28 09:19:26
  • OfStack

i editor:

1, 3 modes: base line mode command mode insert mode

Command mode:

1. Switch insert mode from command:

i: To the left of the cursor type I to move the cursor to the left of the line
o: Next line to move cursor (new line 1) O: Previous line to move cursor (new line 1)
a: Move the cursor to the right of the line and type A: Move the cursor to the far right of the line

2. Copy :(n stands for number)

Line: nyy n > 0
Words: nyw n > 0

3. Paste p

Undo to Step 1 above: u

5. Restore to the previous step: ctrl+r

6. Replacement:

Replace 1 character: r

Continuous substitution: R

7. Positioning line:

On: n -
Bottom: n +

8. Delete:

Delete characters: nx (right) nX (left) n > 0
Delete lines: ndd n,n1 dd

9. Search keyword: /key_value (look down for key:n and look down for key:N)

Bottom row mode:

1. Display line number: set nu

2,

2. Read the content of the text document: cat/more

3. The "permission" of the file for the operation of a "user" :

r read read 4 w write write 2 x Execute excude 1
User: Create u group g others o

Modify permission:

chmod user +, -permission 1, User +, -permission 2 file
-- rw --r-- 1 LF LF 210 July 7 10:27 msg
(see figure 1)
Remove the author's read permission
chmod u - r g - r o - r files
Add permissions:
chmod u+r, g+r,o+r files
Delete/add owner
chmod a-/+ permission file
Per user: 4 read 2 write 1 execute 4+2+1=7 4+0+0=4(read only) 4+2+0=6(read write cannot execute)
chmod - file

4. Users: (Features: 1) Multi-task (process) multi-user operation)
1. Switch user: su user name

2. Add user: useradd (root permission)
3. Change password: passwd password (passworld)
Note: User home directory (/home)

5. Assign root permissions to user commands:

Part of the permissions assigned to the user by root are recorded at: /etc/sudoers

Note: Every time sudo goes to /etc/sudores to check the user's allocation policy

1. Assign permissions for a command to a user on a machine

1.1 Assign all commands for all machines to the user

User name ALL=(ALL) ALL

1.2 Assign a command to all machines for the user

User name ALL=(ALL) command

6. Compiler: Translates the specified language into machine language

The history of language development:

1. Machine language: instructions composed of 0/1 (the computer can recognize them directly)

2. Assembly instructions: Replace base 2 instructions with mnemonics

3. High-level language: Use natural language to communicate with machines

Compiler for Linux: gcc/g++/QT

gcc compiler: a good (1, compiling languages, 2, high quality) compiler
Source: A file of a program written in a high-level language

c language:.c

c++ Language:.cpp.C

java: .java

OC : .oc

Compile:

Note: If the executable file name is not specified, a.out is generated by default

2. Specify executable file name:

gcc source program. c-o executable file name

Executable program: Path/program name

[3, compilation process :(function)]

conclusion

Above is the site to you to introduce Linux system under 3 modes of simple command, I hope to help you, if you have any questions welcome to leave a message, this site will reply you in a timely manner!


Related articles: