1 Common shortcut keys
Virtual mid-end switchover: CTRL+ALT+F2~F6 switch to Virtual terminal (virtual terminal in LINUX5 is f1~ F7, and today's Linux7.0 virtual terminal is F2~F6); ctrl+alt+f1 switch to graphics terminal. (This article mainly takes Linux7.0 as an example)
ctrl+alt+ arrow key: Switch workspace
Ctrl+alt+l: Lock Frequency
1, Common basic command line of Linux
The basic form of the Linux command line is generally: COMMAND + options + parameter options are generally "-" or "--" can also be used to start the Command tab
help command: Mancommand Info Command--help command, etc.
Date command: The general format is "month, day, time, minute, year"
Passwd command: Change Password
File command: The beginning of the sweep surface file that displays the type of the file ( no file name extension in Linux)
Head and the Tail Command : Displays the beginning and end parts of a file
WC command: Count the number of lines, words, and characters of a file
History command: Show the commands you've entered
To view a file command: Less paging display file Cat Direct display file grep extract parts of interest
2. Common Management Files Command
PWD Command displays the current working directory
Ls Command displaying files in a directory
Touch command: create an empty file or modify the timestamp of a file
Cd command: changing the working directory CD can be either a relative path or an absolute path ( Absolute path: Describes the path relative to the directory from the root : Describes the path from the current location)
.. represents the top level directory CD: go back to the top level directory
~ represents the home directory with the current user
- represents the most recently used directory
Mkdir Command , create a directory, create a directory, to ensure that the same directory does not exist originally
mkdir–p all new directories on the path can be created at once
Cp Command when copying files and directories, the timestamp is rewritten to indicate that the file has just been modified, that multiple files can be copied to a directory at the same time, that the entire directory can be copied to another directory, but that the-r parameter is required, and that multiple directories can be copied to a directory at the same time; -v parameter to display which files are copied to the terminal
Mv Command , move or rename files
Rm Command , delete the directory or file, you can delete a single anthology, or delete the directory, but need to add the-r parameter, the-i parameter can open the interaction, the system will ask whether to delete each file
Rmdir Command , delete the empty directory, if the directory is empty, then you can use rmdir Delete, if there are files or subdirectories in the directory, then rmdir will not be able to delete the directory
3. common file wildcard characters
* any string consisting of 0 or more characters
? any one character
~ home directory for the current user
~username username user's home directory
~+ Current Working Directory
~- Previous working directory
[ABC ...] Enclose any one of the characters in the class
[!abc ...] Any one of the characters in the class that is not enclosed
[^abc ...] Any one character in a class that is not enclosed
[[: Alpha:]] any alphabetic character
[[: Lower:]] any small letter
[[: Upper:]] any capital letter
[[: Alnum:]] Any alphabetic character or number
4. File redirection
standard input (0)stdin: Read from the keyboard by default, passed to Chen Xujing's using
standard Output (1)stdout: Normal output of program execution, passed to terminal by default
standard Output (2)stderr: Error message for program execution, passed to terminal by default
Redirect output to file: With redirection, the output (standard error and standard output) that was originally sent to the terminal can be captured as file content, sent to the device, or discarded
redirect stdout file >file redirect stdout to overwrite file >>file redirect stdout to attach to file
redirect stderr to file 2>file redirect stderr to overwrite file 2>>file redirect stderr error message to/dev/mull, discarding it
Merge stdout and stderr to a file >file 2>&1 (or &>file) redirect stdout and stderr to overwrite the same file
>>file 2>&1 (or &>>file) redirect stdout and stderr to attach to the same file
Pipeline build: A pipeline is a sequence of one or more commands, with a pipe character | Split, you can connect the standard output of the first command to the standard input of the next command; Use the Tee command to copy a pipe to a file or terminal
5, the VI editor of Linux
Vim is an improved version of VI
VI Functional Mode: Command mode-for file navigation, cut and paste, and simple commands. Undo, Redo, and other operations are also performed from this mode
Insert mode-This mode is used for long-flying text editing. A variant of the insert pattern when replacing a pattern, which can be substituted instead of inserting text.
Ex mode-the secondary mode is used to save, exit, and open files, as well as search, replace, and other more complex operations. From this mode, the output of the program can be inserted into the current file, as well as the configuration of vim and so on, using ex can realize all the functions can be executed from this mode.
Common shortcut keys in VI
Insert mode: Press the I key of the keyboard to enter, in this mode, any keystrokes entered will be content
Visual mode: Used to select multiple character wakes, using v, v,Ctrl +v., to enter
y : Copy Yank
C : Cut
P : Paste
u : Undo
Start the Extended command mode: For saving, exiting and so on, using: Enter
Q exit (the file cannot be exited if it is changed)
q! forced exit (not saved)
Wq Save Exit
This article is from the "Kang Rice Incense" blog, please be sure to keep this source http://alistine.blog.51cto.com/10034174/1716030
Linux Basics 1