重定向輸入和輸出
$ command > outputfile # 輸出重定向 命令 > 要輸出到的文件
$ date > test6
$ date >> test6 #輸出重定向帆谍, 將輸出流追加到文件后面
重定向輸入和輸出
$ command < inputfile #
wc
$ wc < demo6 #輸出 文本的行數(shù) 文本的詞數(shù) 文本的字節(jié)數(shù)
#2 11 60
$ command << marker #內(nèi)聯(lián)輸入重定向
$ wc << EOF
> test string 1
> test string 2
> test string 3
> EOF
# 3 9 42
管道
$ command1 | command2 #將命令1的輸出流作為命令2的輸入流
$ ls | sort