#重定向
Output redirection:
1> Overlay Output (1 can be omitted)
[[Email Protected]_168_102_centos tmp]# ls functions >>shuchu[[email protected]_168_102_centos tmp ]# Cat Shuchu Fstab
1>> Append output (1 can be omitted)
>>shuchu[[email protected]_168_102_centos tmp]# cat Shuchu fstabfunctions
Error redirection:
2>: Overwrite output
[email protected]_168_102_centos tmp]# ls agent_cmd.sock fstab hellodirxyz scripttest Testceshi functions rc.sysinit >2>shuchufstab[[email protected]_168_102_ CentOS tmp]# cat Shuchu ls:cannot access wanghan:no such file or directory
2>>: Append output
[email protected]_168_102_centos tmp]# cat Shuchu 2>>shuchu[[email protected]_168_102_centos tmp]# cat Shuchu ls:cannot access wanghan:no such file or directory Ls:cannot access ssssdd:no Such file or directoryls:cannot access wanghan:no such file or directory
the standard output and error output are also re-determined :
[[Email protected]_168_102_centos tmp]# ls fstab wanghan >shuchu 2>cuowu[[email protected]_168_102_centos tmp ]# cat Shuchu fstab[[email protected]_168_102_centos tmp]# cat Cuowu ls:cannot access wanghan:no such file or directory< /c4>
[[Email protected]_168_102_centos tmp]# ls fstab wanghan &>all [email Protected]_168_102_centos tmp]# Cat Allls:cannot Access wanghan:no such file or Directoryfstab
[Email protected]_168_102_centos tmp]# ls fstab wanghan >both 2>&1[email protected]_168_102_centos tmp] # cat Both Ls:cannot access wanghan:no such file or Directoryfstab