Knowledge Content:
1.Linux Basic Command Review
2.VI mode and basic operation
3.VI Advanced Operation
First, Linux basic command review
1 Directory (folder) operations2 CD Entry directory (tab auto-complete)3 pwd View current directory4 mkdir Add Directory5 rmdir Deleting a directory6LS view files in the current directory (-l list mode view)7 drwxrwxrwx? d file type is a folder8RWX for permissions, read | Write |Excute9 3 groups of rwx, respectively, the permissions of the file user, the user with the same group of personnel rights, other people's rightsTen The corresponding location is – indicates that the user does not have this permission One chmod A file disk space usage in du directory - DF View full disk space usage - the - file Operations - Touch Build File -Cat View Files (-n automatically add line numbers) + RM Delete File - CP Copy File +MV Mobile/Renaming Files AMore paging view file [only supports rollover--Space] atLess paging view file [support front turn back search –pageup/PageDown] - Head View the first few lines of the file -Tail View the end of the file in a few lines (-f Dynamic viewing of file modifications) -LN creates a linked file [-s Soft connect/Hard Connect] - Soft Link: equivalent to a shortcut under Windows - Hard Link: Shared disk space (equivalent to multiple pointers pointing to the same address, deleting one file without affecting other uses) in - to REDIRECT , Pipeline +>output to file (override) -ls >A.txt writes the output of LS to a file a.txt the>>Output to file (append) *ls >a.txt append the output of LS to the file a.txt back $2>error message output to filePanax Notoginseng>You can only redirect the information that is output to stdout. -2>REDIRECT StdErr's information to the past. the&> Output All information (& equivalent to 0,1,2) +<input from File A|Use the result output (stdout) as the next command line entry the + - system Commands $Su [...] Log in to root user/Other users $Apt-get install/Remove Install delete files - sudo ... Executing commands with root privileges - top Dynamic View system process information (Q exit) the PS Viewing system process information - Kill kills the processWuyi the - Other Commands Wu Find File - Find. –name a.txt Locate the A.txt file in the current directory (. Indicates the current command) AboutFind/dev-name std* in/Dev directory finds files beginning with Std $ grep Find Text - CMP Compare files (rows and columns of output differences) - diff comparison file (text at the output difference) - ifconfig Network Commands (view, modify IP) A + the command line edit shortcut keys -CTRL +a moves to the first character of the command $CTRL +e move to end of command theCTRL +u Delete the first character of the cursor at the command line theCTRL +k Delete the last character at the cursor to the command line theCTRL +L Clear Screen theCTRL +C Cancel -CTRL + ARROW keys to move one word at a time
II. VI Mode and BASIC operation
1.VI mode
- Command mode: Press ESC in any mode to enter, another to enter the VI editor is the command mode, command mode input any word nonalphanumeric as a command to handle
- Insert mode (edit mode): Press A, I, etc. from the command mode to enter, any character entered as nonalphanumeric as the inserted characters
- Last-line mode: In command mode, press: Enter, perform file-level or global operations, such as save file, exit editor, etc.
Basic operation of 2.VI
1 Basic Operations2 The following operations operate in the last-line mode:3 : Q Exit VI (q! do not save forced exit)4 : W Save (Wq Save and exit)5 : x Save Exit6 : X Encryption Save Exit7 : U undo Operation8 : Save SaveAs as9 Ten The following operations operate in command mode: One x Delete current character A DD Delete the current row, delete the contents into the Clipboard - h,j,k,l and left-right move cursor (in some cases the arrow keys are part of the command) - 0 to the beginning of the line the^first non-null character to the beginning of the line - $ to end of line - G_ to the last non-null character at the end of a line - +CTRL +F page Back (forward) -CTRL +b page Forward (back) +CTRL +D turn back half a page ACTRL +u turn half page forward atCTRL +e roll down 1 lines -Ctrl+y rolling up one line
Third, VI advanced operation
Linux operating system 3 VI editor