Command substitution: $ (commands), ' command '
Touch./file-$ (date +%f-%h-%m_%s). txt
There are three types of quotes supported by bash:
": Command substitution
"": weak reference, can implement variable substitution
': Strong reference, do not complete variable substitution
File name wildcard globbing
* Any character of any length
? Arbitrary length single
[] matches any single character within the specified range
[^] outside of the matching range
> Coverage
>> Append Output
-C Disable Overwrite redirection for already existing files
Force overwrite output, use >|
+c turn off the above features
2> redirect Error output
2>> Append method
&> redirect error output or standard output to the same file
< input REDIRECT Cat </etc/fstab
Tr ' A-Z ' A-Z ' </etc/fstab
Cat/etc/fstab/etc/hosts
Cat << EOF Manual input content end with EOF
Cat >>/tmp/myfile.txt << EOF input part of the content is stored in myfile.txt
Pipeline
Take the output of one command as input to another command
echo "Hello, world." | Tr ' A-Z ' A-Z
Cut-d:-f1/etc/passwd | Sort | Tr ' A-Z ' A-Z
cat/etc/passwd | Wc-l number of statistics file lines
Tee output one copy, then save one copy
echo "Hello, world." | Tee/tmp/hello.out
Fetch the sixth line of the file
Head-6/etc/inittab | Tail-1
Take the Nineth line and show the username and shell
Tail-9/etc/passwd | head-1 | Cut-d:-f1,7 | Tee/tmp/users
Linux Learning Record-command substitution-wildcard-redirect-pipeline