Basic operations in the last-line modeYou can set the VI editor environment, save the file and exit and replace the contents of the file.
Switching between modes
aio– "Command mode to input mode
esc-"input mode to command mode
:--"command mode to last line mode
Command mode
Move cursor: JKHL up or down
Paging: page Down/up Ctrl f/b
Line: $ line End 0 beginning
Between rows: G file end 1G file header
Merge: J #J merge several rows
Display line number: Set Nu/nonu
Delete: x single character dd #dd d$ d^
Copy: yy #yy
Paste: p/p
File lookup:/words or? words position n (undo one operation)/n (undo all operations on the row)
Last-line mode
Save file:: wq! Save and Force exit
: W + file location means Save As
: q! Do not save, force quit
To replace the contents of a file:
: S/old/new only one: s/old/new/g for another line
: 3,4s/old/new 3-4 Lines
:%s/old/new/g to replace the entire file (must be written in strict accordance with the rules)
U user h hostname PWD Path $ users Rights
Bash Shell, we can use source to make the file valid
We can modify the command prompt by changing the/etc/profile
Modify Ip:ifconfig by changing the name of the Hostname.elooogo NIC, one file per Nic