Bash features
1.{} and ()
{}: Similar collection, Mkdir-p./test/{a,b} Copy/etc/passwd{,.bak}
(): the execution result of the reference command, mkdir $ (date)
2. Judgment of execution results
echo $?
Success: 0
Failure: 1~255
3. Common shortcut keys
Ctrl+l: Clear Screen
CTRL + A: Cursor jumps to the top
Ctrl+e: Cursor jumps to the end of a career
Ctrl+u: Before deleting the cursor
Ctrl+k: After deleting the cursor
esc+.: Output The object that was last executed
4.globbing pass-to-match mechanism
*: matches any character of any length
?: matches any single character
[]: matches a single character within a specified range, [0-9][a-z][a-z]
[^]: matches a single character outside the specified range
[[: Space:]]: white space characters
5.IO redirection
Coverage: >
Add: >>
Error: 2>,2>>
Merge Normal and error: &>,&>>
Create multiple lines of text: Cat << EOF
...
Eof
Create multi-line text files: Cat >./test << EOF
...
Eof
Looping through row data: while read I;do
Echo $i
Done </etc/passwd
Data black hole: Useradd-r system &>/dev/null
6. Piping
Command Delivery: CAT/ETC/PASSWD | grep "Varnish"
Tee command: Save the execution result of the previous command and pass it on to the subsequent command to continue processing, CAT/ETC/PASSWD | Tee./passwd.bak | grep "Varnish"
7. Aliases
Add Alias: Alias ld=ls-d
Remove alias: Unalias ld
Linux self-study note--bash features