(2). There are a number of different modes:
(3). Exit Vim
(4). Edit command
Cursor Movement:
Move between characters:
H: Cursor moves left
L: Move the cursor to the right
K: Move Cursor up
J: Move the cursor down
Move between words:
W: Move to the beginning of the next word
E: Move to the ending of the next word
B: The first word of the current or previous word
#: Jump N Words at a time
Jump at the end of the beginning line:
0: Jump to the absolute beginning of the Non-tab character
^: Jump to first non-whitespace character
$: Jump to absolute end of line
Jump between sentences:
): Jump to the beginning of the next sentence
(: Jump to the first sentence
Move between paragraphs:
}: Jump to next paragraph
{: Jump to previous paragraph
Fast movement between lines:
#G #表示想要跳转的行数
G: Article tail
1 G: Article header
Last-line mode: n jumps to n rows
Edit operation:
X: Delete the character at the cursor location
#x: Delete the # characters that are at the cursor and backwards
R: the character at which the cursor is replaced
D: Delete command:
DD: Delete the line where the cursor is located #dd: Delete the line with the cursor and the total # line of the downstream:
Use with Jump commands
d$: Delete the contents of the cursor at the end of the line; D: Same
d^: Delete the contents of the cursor at the beginning of the line
DW,DE,DB: These 3 commands support using # to indicate the number of words covered
P: Paste:
Line level:
P: Paste below the line where the cursor is located
P: Paste above the line of the cursor
Y: Copy
YY: Copy cursor row Y: Copy a whole row
#yy: Copy cursor row and line total # line
d$: Copy the contents of the cursor at the end of the line
d^: Copy the contents of the cursor at the beginning of the line
YW,YE,YB: These 3 commands support using # to indicate the number of words covered
C: Modify
CC: Deletes the entire line of the cursor and immediately transitions to input mode
#cc:
C$,c,c^,c0,cw,cb,ce
Undo Action:
U: Undo
#u: Undo # Operations
Cancel the last action:
Ctrl+r
Repeat the previous command
(5). Visualization mode:
V: Select the content at the left of the cursor line cursor
V: Select the content on the right side of the line where the cursor is located
(6). Flip Screen command in edit mode
CTRL+F: Flip a screen to the end of the file
CTRL+B: Flip a screen to the file header
Ctrl+d: Turn half screen at the end of the file
Ctrl+u: Turn half screen to file header
(7). Text Lookup
/pattern
? PATTERN
N: Find text trailing
N: Finding the Text header
(8). Text substitution
Last-line mode: Built-in command interface with command history function
There are some built-in commands for editing operations, which can be done using the address-bound method
Address delimitation
Startline[,endline]
#: Line #
.: When moving forward
$: Last line
%: Full text
Relative delimitation:
+#: Down # lines from a specified position
-#: Up # lines from a specified position
Text substitution command: s
s/what to look for/replace with content/modifiers
/: Delimiter, used to split "what to find" and "Replace with": This delimiter can use other characters, such as @, #等:
What to look for: You can use regular expressions: This section can be referenced in the "Replace with Content" section later using the "&":
What to replace: The regular expression is not available, generally normal text, but you can use the \1,\2 in regular expressions,.... What's Saved
Modifier:
I: Case insensitive when looking for characters
G:global, global substitution;
(9). Multi-File Mode:
Open File:
Vim [OPTION] ... [FILE] ...
+#: Quickly navigate to # lines
+/pattern quick position to the first match to the line by the pattern
Multiple files:
Vim FILE1 FILE2 FILE3 ...
Last-line mode:
: Next Next
: Prev Previous
: Last One
: First One
Exit All Files:
Wqall Save All and exit
Wall Save All
Qall Quit all
Multiple windows:
-O horizontal Split window ctrl+s horizontally split document
-O vertical Split window Ctrl + V vertically split document
(10). Interface Features
Turn off line display:
Set nu
Set Nonu
To turn on the syntax highlighting feature:
Synatx (On|off)
To turn on the search highlighting feature:
Set Hlsearch
Set Nohlsearch
To turn on the Auto indent feature:
Set Autoindent:set AI
Set Noautoindent:set Noai
Character Case Sensitivity:
Set Ignorecase:set IC
Set Noignorecase:set Noic
(11). configuration file
Global:/ETC/VIMRC
Personal: ~/.VIMRC
2, summarize the document Search command find use method;
Find
(1). Order Explanation:
Implements a file that finds properties that match the specified criteria by traversing the specified target directory
(2). Command syntax:
Find[options] [Find path] [find condition] [handle action]
Find path: Default to Current path
Find condition: defaults to all files under the specified path
Handling actions: Default to Print to screen
Search criteria:
-name: "File name": FileName support using globbing
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps4905.tmp "border=" 0 "alt=" wps4905.tmp "src=" http://s3.51cto.com/wyfs02/M00/72/84/ Wkiom1xltmsg4qbpaabohipjx5y198.jpg "349" height= "/>"
-iname: "File name" is case insensitive
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps4906.tmp "border=" 0 "alt=" wps4906.tmp "src=" http://s3.51cto.com/wyfs02/M02/72/81/ Wkiol1xltuwgpzpaaabersb1tye072.jpg "" 345 "height="/>
-user: Based on owner Lookup
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps4917.tmp "border=" 0 "alt=" wps4917.tmp "src=" http://s3.51cto.com/wyfs02/M01/72/84/ Wkiom1xltmxagn5caabj0cwcuza150.jpg "" 558 "height="/>
-group: Search by Genus Group
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps4918.tmp "border=" 0 "alt=" wps4918.tmp "src=" http://s3.51cto.com/wyfs02/M02/72/84/ Wkiom1xltmwjf0ssaabib8hmjog289.jpg "" 554 "height="/>
-uid: Search by UID number
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps4919.tmp "border=" 0 "alt=" wps4919.tmp "src=" http://s3.51cto.com/wyfs02/M00/72/84/ Wkiom1xltmxdldqtaabbiepluqw493.jpg "" 558 "height=" "/>
-gid: According to the GID number to find
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps491a.tmp "border=" 0 "alt=" wps491a.tmp "src=" http://s3.51cto.com/wyfs02/M01/72/84/ Wkiom1xltmwbffg4aabdgijf4cy465.jpg "" 538 "height=" "/>
-nouser: Finding files that are not owned by the master
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps491b.tmp "border=" 0 "alt=" wps491b.tmp "src=" http://s3.51cto.com/wyfs02/M02/72/84/ Wkiom1xltmwdbyeraabyjnhdwfs547.jpg "" 558 "height=" "/>
-nogroup: Finding files that are not owned by a group
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps491c.tmp "border=" 0 "alt=" wps491c.tmp "src=" http://s3.51cto.com/wyfs02/M00/72/84/ Wkiom1xltmbzpwouaabeut-jiho926.jpg "" 536 "height="/>
Combination Lookup:
With-A (find out that the/tmp directory has write permissions and is the root file:
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps492c.tmp "border=" 0 "alt=" wps492c.tmp "src=" http://s3.51cto.com/wyfs02/M01/72/84/ Wkiom1xltmbtjwjuaac4oagqvea578.jpg "" 558 "height="/>
Or-O (Find the file with the name 123 in the/tmp directory, or the UID is 600
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps492d.tmp "border=" 0 "alt=" wps492d.tmp "src=" http://s3.51cto.com/wyfs02/M02/72/81/ Wkiol1xltubioqadaabe33tus0i989.jpg "558" height= "/>"
Non--not (find files that are neither root nor hzm users in the/tmp directory
650) this.width=650; "Style=" background-image:none; border-bottom:0px; border-left:0px; margin:0px; padding-left:0px; padding-right:0px; border-top:0px; border-right:0px; padding-top:0px "title=" wps492e.tmp "border=" 0 "alt=" wps492e.tmp "src=" http://s3.51cto.com/wyfs02/M00/72/81/ Wkiol1xltuadimtpaabgngaohzu625.jpg "" 558 "height="/>
3, summarize the content of bash environment variable;
4. Summarize the knowledge points of special permissions (SUID, SGID, Sticky) on Linux file system;
5, summarize the Linux Disk Management, file system related knowledge points and the use of related commands;
6, copy the/etc/grub.cfg configuration file to the/tmp directory, use the Find replacement command to delete the/tmp/grub.cfg file at the beginning of the blank character;
%s/^[[:space:]]\+//g
7. Copy the/etc/rc.d/init.d/functions file to the/tmp directory, and add a # to the beginning of the line beginning with a blank character for each line of/tmp/functions with the find replacement command; The original whitespace character is reserved;
%s/^[[:space:]]/#&/g
8, replace the/etc/sysconfig/init in/tmp/functions file is/var/log;
%s/\etc\sysconfig\init//var/log/g
9. Delete the beginning of the line in the/tmp/functions file so #, and # followed by at least one blank character #;
%s/^#[[:space:]]\+//g
10, find the/var directory is the owner of the root, and belong to the group mail all files;
11. Find all files that are not root, bin or hadoop under the/usr directory;
12. Find all files whose contents have been modified and are not root or Hadoop for the last week in/etc directory;
13. Find all files on the current system that are not owned by the master or group, and have been visited in the last week;
14. Find all files of more than 20k and type of ordinary person in/etc directory;
15, look for all the users in/etc directory do not have permission to write files;
16. Find at least one class of users who do not have permission to execute files in/etc directory;
17, find/etc/init.d directory, all users have execute permission, and other users have write permission files;
19, create the directory/test/data, let a group of ordinary users have write permission to it, and all the files created by the group of directories belong to the group, in addition, each user can only delete their own files;