Linux shell and shell
<Span style = "font-size: 14px;"> -------------------------------------- shell application tips ------------------------------------ command completion: tab key completion shell command 2: clear or ctrl + l clear screen ctrl + u clear all the content before the cursor history list all the commands you have typed named alias definition: alias view alias copy = cp directly copy it next time. alias xrm = "rm-r" unalias copy deletes alias input/output redirection (shell scripts are often used) 0 (stdin) standard input 0 <1 (stdout) standard output 1> 2 (stderr) standard error output 2> A:> output redirection ls-l/tmp>/tmp. msg places the result obtained by the ls-l command to/tmp. msg, redirect the information to a file more/tmp. after msg can view the content of the redirected file, press data>/tmp. msg you will find that the above redirection content has been overwritten by data>/tmp. msg, the content will be appended to the redirection content above. B: <input redirection wall </etc/motd broadcast file content. motd is the content to be broadcasted. C: 2> error output redirection (2> indicates execution in case of an error) the usr directory is equivalent to the Windows directory, and the system's core directory is cp-R/usr/backup/usr. bak 2>/bak. example: ls xxxxxxx a non-existent file ls/xxxxxxx 2> ls. when the ls command fails, err stores the error information in the error file. Pipeline explanation: transfers the output of a command to another command, command 1 | command 2 | command 2 | ..... | command n (multiple commands can be connected) Example: ls-l/etc | more queues the ls output content to more pages to view ls-l/etc | grep init queues the ls command content to grep to view only the init file ls-l /etc | grep init | wc-l check the number of init files in the etc directory (multiple pipelines) command connector 1; the execution of each command at intervals is in the order of 2 & (connect two Commands). The execution of the preceding command has a logic and a relationship. Only when the execution of the preceding command is successful, command 3 after execution | (connect two Commands) There is a logic or relationship between the execution of the command before and after, only | after the execution of the preceding command fails, the following commands are executed: 1 pwd; ls; 3 data commands are executed in sequence. Scenario 2: The machine writes a love letter to your favorite technology MM, delete write MM after writing