1. Press the TAB key for the command to be padded
2, clear or ctrl+l clear screen
3, ctrl+u Delete the command before the cursor
4. History view executed commands
5, the key of the arrow keys can see the executed command
1. Command aliases
Example: Alias COPY=CP//The CP command can be implemented with copy at this time, if the command has parameters, you need to enclose the command in quotation marks
Remove Alias: Unalias alias
2. Input \ Output redirect
(1) Output redirection
Example: Ls-l/tmp >/TMP.MSG//Save the results of the previous command in a later file
LS-L/tmp >>/TMP.MSG//Append the results of the previous command to the following file
(2) Input redirection
Example: Wall </etc/filename to broadcast the information in filename '
(3) Error redirection
Syntax:2> error output redirect, 2 is the file identifier of the standard error output
Example: Cp-r/usr/backup/usr.bak 2>/bak.error command execution error message saved to Bak.error file
3. Pipeline
Sends the output of one command to another command as input to another command
Grammar:
Command 1| command 2....| Command n
Instance:
Ls-l | More
Ls-l/etc | grep Init
4. Command connector
(1):
Each command executes sequentially in sequence.
(2) &&
There is a logic and relationship between the execution of the preceding command, and the subsequent command executes when the previous command executes successfully.
(3) | |
The execution of the previous command has a logical or relationship, and when the first command executes successfully, the second command is not executed; the second command executes when the first command fails
5. Command substitution
To use the output of one command as a parameter to another command
Syntax: Command 1 ' command 2 '//is not a single quotation mark, is the left side of the keyboard 1 small apostrophe; At this point, the output of command 2 as a parameter of command 1
Shell Application Tips