Command 1: alias
An alias is used for convenience. If you have a frequently-used command for a long time, you can set an alias to be equivalent. For example, the default alias of LS-Alf is ll.
The alias format is as follows:
Alias alias = command
Alias alias = "command combination"
Alias allows you to view the configured aliases
Unalias alias Delete alias
Command 2: Input/Output redirection
Output redirection
Input the result of a command to a file.
For example:
Ls-L/ABC>/ABC. MSG Overwrite
Ls-L/ABC>/ABC. MSG append Does Not Overwrite
Input redirection
Wall </abc.txt
Error output redirection
Ls/ABC 2> ls. Error
If the execution of LS/ABC is normal, it will not be output to LS. Error.
If the LS/ABC execution fails, for example, the ABC directory does not exist, it will be output to LS. Error.
Command 3: MPS queue
Use the result of the previous command as the input of the next command.
For example, if you want to view LS-L/etc, but you want to view too much content by page, you can use the pipeline symbol | in series: ls-L/etc | more
You can set multiple MPs queues.
For example, to view the number of init-related files in LS-L/etc, use LS-L/etc | Gret init | WC-L.
Command 4: Command Connector
1. execute commands in sequence and connect
Example: whoami; PWD; Date
2. After the previous command is successfully executed, the next command will run & connect
Example: Write Mary </love.txt & RM/love.txt
3. If the previous command fails to be executed, the next command will be executed. | connection
Example: Write Mary </love.txt | mail Mary/love.txt
Command 5: Command replacement character
Use the execution result of one command as the parameter of another command :''
Example: ls-l 'which Touch'