stdin: 0
stdout: 1 Shell的默认值。
stderr: 2
常见于:
ls -l 1 > /dev/null 2>&1将stdout重定向到“虚空”, stderr追加给stdout“虚空”的另一个用法
[oracle@odilab ~]$ ls -ltrh 1.txt
-rw-r--r-- 1 oracle oinstall 11M Jan 12 22:52 1.txt
[oracle@odilab ~]$ cat /dev/null > 1.txt
[oracle@odilab ~]$ ls -ltrh 1.txt
-rw-r--r-- 1 oracle oinstall 0 Jan 13 01:22 1.txt
本文介绍了Shell命令中关于文件重定向与使用'虚空'的高级技巧,通过具体实例展示了如何利用这些特性进行高效的数据处理与文件管理。

1474

被折叠的 条评论
为什么被折叠?



