1
----------------------------------------------------------------------------------------------
View Catalog: Ls-a or Ls-r
View Log file: Cat file name. log
--------------------------------------------------------------------------
How to view partial file Content command head,tail,sed in Linux
The most common Cat,less,more and vim for viewing file content in Linux
--------------------------------------------------------------------------
2
----------------------------------------------------------------------------------
To delete a folder instance:
Rm-rf/var/log/httpd/access
The/var/log/httpd/access directory and all files and folders under it will be deleted
To delete a file usage instance:
Rm-f/var/log/httpd/access.log
This file will be forcibly deleted/var/log/httpd/access.log
---------------------------------------------------------------------------------------------------
3
Manipulating files
1: Take action file $ VI file name
2: After entering through the keyboard on, down, left, and right to move, this can be deleted, but not insert operation (cannot enter) VI, is in the "command-line mode"
3: Click the letter "i" to enter "Insert Mode", then you can start to enter the text
4: You can only enter text, if you find the wrong word! To move back with the cursor key, delete the word, then click the "esc" key to go to "command mode" and then delete the text.
5: Save exit under Command mode, click the ":" colon key to enter "last line mode", for example:
: w filename (enter "w filename" to save the article with the filename you specified)
: Wq (input "wq", save and Exit VI)
: q! (Enter q!, do not save the mandatory exit VI)
(
Press "ctrl"+"b": The screen moves one page to the back.
Press "ctrl"+"f": The screen moves one page toward the front.
Press "ctrl"+"u": The screen moves the half page toward the back.
Press "ctrl"+"d": The screen moves the half page toward the front.
"0" by number: Moves to the beginning of the article.
Press "g": Moves to the end of the article.
Press "$": Moves to the end of the line where the cursor is located.
Press "^": Move to the beginning of the line where the cursor is located
Press "w": The cursor jumps to the beginning of the next word
Press "e": The cursor jumps to the end of the next word
Press "b": The cursor returns to the beginning of the previous word
Press #l: The cursor moves to the first # position of the line, such as: 5l,5 6l.
)
(
Delete text
"x": Delete the "after" character at the cursor location every time you press it.
#x: For example, "6x" represents the "after" 6 characters of the location where the cursor was deleted.
"x": An uppercase X, each time it is pressed, deletes the "front" character at the cursor location.
#X: For example, "20x" represents the "front" 20 characters of the location where the cursor was deleted.
"dd": Deletes the row where the cursor is located.
#dd: Deletes the # line from the line where the cursor is located
Copy
"yw": Copies the character at the end of the cursor to the buffer.
#yw: Copy the # Word to buffer
"yy": Copy the row of the cursor to the buffer.
#yy: For example, "6yy" represents a copy of 6 lines of text from the line where the cursor is located.
"p": Paste the characters in the buffer to the cursor location. Note: All copy commands related to "Y" must be mated with "P" to complete the copy and paste function.
Replace
"r": Replaces the character at which the cursor is located.
"r": Replaces the character where the cursor is located until the "esc" key is pressed.
)
-------------------------------------------------------------------------------------------------- ----------------------------------------------