Knowledge of Linux commands, help, basic file operations, backup commands,vi editor usage1. Understanding Linux commands1)thelinux command is complete with a class of functions, options complete specifically. 2) command ----Shell(command interpreter)----- Kernel (kernel) This is the command execution process;Depending
in the current row with P2: n1,n2s/p1/p2/g: All P1 in line N1 to N2 are replaced with P2 ": 2,7s/ma/ma666/g": g/p1/s//p2/g: Replace all P1 in the file with P2 ": g/ma/s//ma5555/g"G/makaidong/s//macaihong/gG/macaihong/s//makaidong/g5. Line Mode command: N1,N2 CO N3: Copy the contents of the N1 line to the N2 line under the N3 line "similar to copy copy: 2,3 Co 10": n1,n2 m N3: Moves the contents of the N1 line to the N2 line below the N3 line "move similar to clip: 2,3 m 18": n1,n2 D: N1 The con
the contents of the pasteboard after the cursor
P (uppercase)
Insert the contents of the pasteboard in front of the cursor
Rx
Replace the character of the cursor position with X
U
Undo the last change
U
Restores the contents of the current row
X
Delete the character of the cursor position backwards
X
Remove the characters in front of the cursor forward
Nx
Delete t
Recently learned the Linux shell, understand the VI editor in the common commands, especially when the configuration file is very long, the use of these commands is very convenient. Here is a brief introduction to some common simple commands.VI Common CommandsH cursor moves one character to the leftL MOVE the cursor on
Work for so many years, vi editor to the command up to a few1.yy: Copy the current cursor in the row2.nyy:n is a number, copying the n rows after the current cursor starts3.P: Paste copied content to the cursor in the row4.DD: Delete When moving forward5.NDD: Delete n rows6./name: Search for a vegetarian7.G: Cursor moves to end of file8.nG: Cursor moves to nth row9.U Cancel Previous action10.$ beginning11.0
Common commands in the vi Editor
After so many years of work, the vi editor can use only a few commands at most.
1. yy: copy the row where the current cursor is located2. nyy: n is a number. Copy the N rows after the current cur
the contents of the pasteboard after the cursor
P (uppercase)
Insert the contents of the pasteboard in front of the cursor
Rx
Replace the character of the cursor position with X
U
Undo the last change
U
Restores the contents of the current row
X
Delete the character of the cursor position backwards
X
Remove the characters in front of the cursor forward
Nx
Delete t
Command mode (ESC)K Move up one lineJ Move down one lineH move one line to the leftL Move Right One line6j Move Down 6 rows5k Move up 5 rows0 Place the cursor at the beginning of a row$ put a cursor at the end of a lineW move a cursor to the next wordb move the cursor to the previous wordCTRL + B Roll back one screenCTRL + F roll forward one screen: x moves the cursor to the X row: 3 Moves the cursor on the third row: Set NU Displays line number/what/What to look for (remember two times ESC afte
.4, if you delete a character, then use the "delete" key, in the edit mode or exit edit mode can be deleted.5, if the editor has completed the change how to save the exit? Just exit edit mode and press ": Wq" to enter. : W saves the file but does not exit vi:w. File to save the modification to file without exiting vi:w! Force save, do not eject Vi:wq save file and exit vi:wq! Force save file and exit Viq: Do not save file, exit vi:q! Do not save the
document to its original state
Zz
If the document does not change, then do not store away, if the document has been changed, then the store left, equivalent to: Wq
: w [filename]
Save the edited document as FileName
: R [FileName]
Reads the contents of the filename document below the line where the current cursor is located
: Set Nu
Show line numbers at the beginning of each line
: Set Nonu
Cancel lin
can not modify the editor.Family.51cto.blog.comEdulWww.baid$u.comwww.ywtou.top$~~~ (tilde fills an unfilled line)~~"Port.txt" 4L, 57CNext: Is the last line mode, the last line mode is the input colon can enter the last line mode as shown belowFamily.51cto.blog.comEdulWww.baid$u.comwww.ywtou.top$~~~~~~: Shown so that in the last line mode we can execute some exit save commandsvi Editor text save and Exit commandsSave and Exit command descriptionW Save
to N2 are replaced with P2: g/p1/s//p2/g: Replace all P1 in the file with P27) Option settingsAll: List all option settingsTerm: Set terminal typeIgnorance: ignoring case in searchList: Display tab stops (CTRL+I) and end-of-line flags ($)Number: Show line numbersReport: Displays the number modified by the line-oriented commandTerse: Displays a short warning messageWarn: Displays no write message if the current file is not saved when you go to another fileNomagic: Allows the use of special chara
This article is your own study notes, welcome reprint, but please specify the source: http://blog.csdn.net/jesson20121020The most powerful text editor under Linux is Vi/vim, and its commands, if used flexibly, are more efficient than other text editors when writing programs or editing text.Vi/vim There are no menus, only comm
the VI Editor, commands have the following characteristics:* commands are case-sensitive, that is, size-sensitive;* commands are not displayed on the screen when the command is entered;* You do not need to enter the ENTER key after entering the command.There is also a set o
, commands have the following features:
* The command is case-sensitive, that is, size-sensitive;
* When you enter a command, the command is not displayed on the screen;
* Enter is not required after the command is entered.
At the same time, a group of commands are displayed at the bottom of the screen, and there are special symbols before these commands, such as
Vi Editor, vi EditorVi editor Introduction
Vi Editor, usually called vi, is a text editing program widely used in various UNIX and Linux systems. It has powerful functions, but it has m
2011-06-14 wcdj
(1) ex command(2) Use ex for editing(1) line address(2) define the row range(3) line address character(4) Search Mode(5) Redefine the location of the current row(6) Global Search(7) combined ex command(3) Saving and exiting files(1) Rename the buffer(2) Save some files(3) add to an existing file(4) copy the file to another file(5) Editing Multiple files(1) Call VI to open multiple files(2) Use the parameter list(3) call a new file(4) s
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.