Write shell output to a file in Linux

Source: Internet
Author: User

As you know, you can use shell to output information to the screen. However, if the output content is too large and redundant, it is not easy for us to analyze and extract the screen information we want, so how can I write shell output into a file?

The following two pipeline commands can be used:

1. > Symbol indicates writing information to a file

2.
> Symbol indicates adding information to an existing file

For example
The output of LS-L is as follows:

How can I write shell output to a file? Command: ls-L./test.txt (This indicates to write the LS-l command output to the test.txt file of the current directory)



This wayA test.txt file will be generated under the current directory to see if the information in the file is the same as the information output on the screen.

Similarly,> the same is true for the management belt command. It only writes information appended to an existing file.

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.