标准输入与标准输出

输入cat 命令时,他会从stdin(对通断界面来说,标准输入就是键盘)接受输入,
cat < testfile ,现在cat命令会用testfile文件中的行为作为输入,可以使用这种技术将数据输入到任何能从stdin接受数据的shell命令
stdout 在终端界面上,标准输出就是终端显示器。
ls -l > test2 输出
ls -l >> test2 追加

ls -l 2> error.log 重定向错误,只会把错误信息存入,正确的结果还会显示在终端显示器

ls -l hellokitty 2> testerr 1> result 错误和结果分开

ls -l hellokitty &> result 错误和结果在同一个文件但是位置变了,错误会集中在一起

posted @ 2017-06-06 16:42  牵牛花  阅读(513)  评论(0编辑  收藏  举报