Linux basics,
Basic
Ctrl + a move the cursor to the beginning of the line
Ctrl + e move the cursor to the end of the row
Find./*-name 20171118 * # view the files whose names start with 20171118 in the current directory
Grep-r 66072./* # view files containing 66072 strings in the current directory
Control + z
Bg // place on the background
Fg // return to the front end
User
[Root @ localhost ~] # Useradd chaoge-m # Add a user and create the home Directory
[Root @ localhost ~] # Passwd chaoge # create a password
Permission
// Modify file permissions. u owner, g user group, o others, a = u + g + o,
Chown-R ubuntu: ubuntu/log # chown [Option]... [owner] [: [group] file...
Chmod 755-R/log # modify folder permissions 755
Chmod u + x log. sh # grant the execution permission
Chmod u = rw, g = rw, o = rw test. py # chmod u =, g =, o = test. py.
Chmod a = rw test. py
Vi Basic commands
Cursor command
K, j, h, l: move the cursor up, down, left, and right
W, B: Let the cursor skip a word forward or backward.
0, $: Move to the beginning and end of the line
NG: Jump command. N indicates the number of rows. This command immediately redirects the cursor to the specified row.
Edit command
I, a, r: insert character commands (I = insert, a = append, r = replace) before, after, and where the cursor is located ).
I. A: insert text at the beginning and end of A row
O and O: insert an empty row after and before the current row
Delete: D Delete the character after the cursor, d0 Delete the character before the cursor
U, ctrl + r: undo, undo
Indent: Right>, left <, for example:> (1 to 4 rows indent to the right)
Replace: % s/abc/123/g # Replace all rows abc with 123. 123 s/abc/123/g # Replace 1 to 10 lines of abc
Row number: Display set nu, cancel set nonu
Copy: 6, 9 co 12 # copy the content between 6th rows and 9th rows to the end of 12th rows.
Delete: 5, 9 de
SSH
Connection: ssh-I xxx. pem ec2-user@172.31.105.11
SCP
// Synchronize
Scp-I xxx. pem ec2-user@54.169.180.222:/log/logs 1031.log/Users/Desktop
Scp-I xxx. pem/Users/Desktop/terminal 1031.log ec2-user@54.169.180.222:/log/
Compile a C language file into a dynamic library
Gcc xxx. c-shared-o libxxx. so