################################################
: Overwrite output
"Append output
SET-C: Prohibit overwrite
Set +c: Turn off disable overrides
################################################
2>: Redirect Error overwrite
2 ": redirect Error append output
################################################
&>: Errors are correctly redirected to a file
[Email protected] testcp]# ls/homes &>/tmp/t1.txt ls/home&>/tmp/t1.txt
[Email protected] testcp]# Cat/tmp/t1.txt
LS: Unable to access/homes: No file or directory
LS: Unable to access LS: no file or directory
/home:
James
Jameszhan
Jameszhan
Lost+found
Newtest
Testcp
[Email protected] testcp]# Vim/tmp/t1.txt
LS: Unable to access/homes: No file or directory
LS: Unable to access LS: no file or directory
/home:
James
Jameszhan
Jameszhan
Lost+found
Newtest
Testcp
################################################
<: Input redirection
The: Here Document
################################################
Pipeline
Command 1 | Command 2 | Command 3 | ...
Tee: Save the standard input to a file, and standard output to the screen
[[email protected] testcp]# echo ' Hello ' | Tee/tmp/hello.txt
Hello
[Email protected] testcp]# Cat/tmp/hello.txt
Hello
[Email protected] testcp]# Wc-l/etc/passwd | Cut-d '-f1
32
This article is from the "James Zhan Linux Advanced ops" blog, so be sure to keep this source http://jameszhan.blog.51cto.com/10980469/1875539
Linux Essentials -11,io redirects and pipelines