VI myfile in command mode I enter insert mode ESC enter Command mode will typo delete I again into insert mode edit
: w filename Input "w filename" Save the article with the filename you specified
H, J, K, L, respectively, control the cursor left, bottom, up, and right to move one grid
X: Every press, delete the "after" character at the cursor location, 6x delete the cursor position 6 characters
x: Uppercase X, each time you press, deletes the "front" character at the cursor location. 6X Delete the "front" 6 characters at the cursor location
DD: Deletes the line where the cursor is located. #dd: Delete # lines starting at the line where the cursor is located
U: If you mistakenly execute a command, you can immediately press U, go back to the previous action
The "#":"#" number represents a number, enter a number after the colon, and then press ENTER to jump to the line, such as entering the number 15, and then enter, you will jump to the 15th line of the article.
W: Enter the letter "w" the colon to save the file.
Q: Press "q" is the exit, if you cannot leave VI, you can "q" followed by a "!" Forced to leave VI.
QW: Generally recommended to leave, use with "w", so you can also save the file when exiting.
YW a word at the location where the cursor is copied
YY the line where the cursor is copied
P Paste
U Cancel operation
Or? Find, enter what you are looking for in/after
MV A B Rename directory A to B MV move the/a directory to/b and rename to C
VI filename Opens or creates a new file and places the cursor at the beginning of the first
View filename opens a file as read-only
VI +n filename Opens the file and places the cursor on nth line
VI + filename Opens the file and places the cursor on the last line
VI +/pattern filename Opens the file and places the cursor at the first match of the pattern
Vi-r filename in the last VI edit is a system crash, restore filename
H J k L Normal mode lower left top right
D (Delete)
V (visual selection)
GU (variable capitalization)
GU (variable lowercase)
: W Save but do not exit
: Wq Save and exit
: Q Exits, if the current file is not saved, exit is forbidden
: q! Do not save, force quit
: w file1 Save the content to file 1, note: The original file is still being edited at this time
: e! Discard all changes and edit from the last time the file was saved
ZZ with: Wq
: SaveAs path Current file Save as Path
/word looks for a string with the string name Word after the cursor.
Repeat Last Action
? Word looks for a string with a string named word before the cursor?? Repeat last forward lookup
N finds the next character backwards from the current cursor
N finds the next character forward from the current cursor
: S/word1/word2/g looks for word1 string in the current line and replaces the string with Word2
: N1,n2s/word1/word2/g looks for word1 between N1 and N2, and replaces the string with Word2 (common)
: 1, $s/word1/word2/g look for the word1 string from the first line to the last line and replace the string with Word2 (common)
: 1, $s/word1/word2/gc look for the word1 string from the first line to the last line, and replace the string with Word2! and display the prompt character before the substitution to confirm (conform) whether the user needs to be replaced (common)
: n1,n2d Delete the contents of line N1 to N2, for example: 10,20d
: nd deletes the contents of the nth row
:%d Delete all contents
: N1,N2 Co n3 copies the contents of the N1 line to the N2 line after the first N3 line
: n1,n2 m N3 moves the contents of the N1 line to the N2 line after the N3 line
: N Moves the cursor to the nth row
:%!xxd Switch to binary mode
:%!xxd-r Switch to file mode
: G/word lists all lines that contain word words
: History Lists all historical records
: His C lists all the line command records
: His s lists all the search records
Q: Display the History window of the line command
q/Display the History window of the Find command
File packaging
MV Aaa.txt. /move files to the previous level directory
MV Aaa.txt aaa/Move the files under the AAA folder
Zip-r/home/dump/weixin_tp_yyyymmdd_ip.zip Weixin_multi compress the files
Unzip Weixin_tp_yyyymmdd_ip_p.zip unzip the file.
mkdir New File
Touch filename New txt
Mkdir-p/HOME/WEIBLOGIC/AAA/BBB Creating a multi-level directory (starting from the root directory)
Cat-b Display Line numbers
Cat-n file displays line numbers, including blank lines
More file to view the contents of files, the space bar to view the next page, Q exit
Less file paging to view the contents of files, space next page, arrow key Q exit
Head view file header content Head-c nk Head-n
Tail display file at the end of 10 lines-C NK display nkb Content-n display N-line Content-F dynamic Display file contents CTRL + C Combo Key exit
Wc
10.4.233.6:mall 8003 vehicle 8001 ibuy 8002
Cleanup server: Cd/home/weblogic/upload
Restart Server: CD Tpdata/weblogic/user_projects/domains/malldomain
View server logs: CD tpdata/weblogic/user_projects/domains/malldomain/servers/mallappserver1/logs/
10.4.233.41:minisite 8001
Cleanup server: Cd/home/weblogic/upload
Restart Server: CD tpsys/weblogic/user_projects/domains/minisitedomain/
View server logs: CD tpsys/weblogic/user_projects/domains/minisitedomain/logs/
10.4.233.43:mall-mgr 8001 esb-mgr 8002 svc-log 8003
Cleanup server: Cd/home/weblogic/upload
Restart Server: CD tpsys/weblogic/user_projects/domains/admindomain/
View server logs: CD tpsys/weblogic/user_projects/domains/admindomain/logs
10.4.233.8:ipay 8001
Cleanup server: cd/home/weblogic/upload/
Restart Server: CD Tpdata/weblogic/user_projects/domains/esbdomain
View server logs: CD tpdata/weblogic/user_projects/domains/esbdomain/logs/
10.4.233.55:union pension
Cleanup server: cd/home/weblogic/upload/
Restart Server: CD tpsys/weblogic/user_projects/domains/tplmalldomain/
View server logs: CD tpsys/weblogic/user_projects/domains/tplmalldomain/logs/
10.4.233.57:svc-api 8001
Cleanup server: cd/home/weblogic/upload/
Restart Server: CD tpsys/weblogic/user_projects/domains/tppmalldomain/
View server logs: CD tpsys/weblogic/user_projects/domains/tppmalldomain/logs/
10.4.233.57:tmall 8001
Cleanup server: cd/home/weblogic/upload/
Restart Server:/tpdata/weblogic/user_projects/domains/tmallvehdomain/
View server logs:/tpdata/weblogic/user_projects/domains/tmallvehdomain/logs
Background permissions added: 1. Permissions List 2. Role List Allocation resources
SVN management: Add user name and password: Tpdata/cntaiping-data/users/auth passwd
Add users and remove permissions for users: tpdata/cntaiping-data/apache-webroot/user/include/admins.php
Wechat:nginx Pre-machine verification: 10.94.210.22 Root/tplife cd/usr/local/nginx/conf/
Less nginx.conf
CD Vhosts/ls
Vim baoxian.itaiping.com.conf
.. /.. /sbin/nginx-s Reload
View server consuming disk space
Java_pid3848.hprof Memory Overflow Log
Ls-rtal
Du-sh *
Du-sh java_pid*
RM-RF java_pid*
Df-h
Less Hs_err_pid9841.log
LINUX Ulimit Commands
Common Linux Operations