Linux Learning Commands Summary ⑨

Source: Internet
Author: User

#重定向

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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.