Why does someone like to write/dev/null in linux?

Source: Internet
Author: User
Token has something, But input devnull to check whether there is anything. = 1>/dev/null 2> & 1 &
Why do I write it in/dev/nullcontext? I have tested that there is something in the input a.txt, but there is nothing in the input/dev/null.

Reply content:

= 1>/dev/null 2> & 1 &
Why do I write it in/dev/nullcontext? I have tested that there is something in the input a.txt, but there is nothing in the input/dev/null.

/Dev/null is a black hole.
It is mainly used to discard output information.

This is output redirection and does not display standard output (STDOUT) and error message (STDERR)

/Dev/null is a black hole. Nothing is thrown in.
Therefore, use/dev/null.

You can understand that dev/null is a garbage dump, or a black hole, and nothing goes in .. Locate some useless output here and it will disappear...

/Dev/null is a special character device in linux. It is mainly used to discard output information and filter out error information, which helps you quickly find the cause of the error.

This is the result. When an error is handled, the output from stderr is discarded to the file/dev/null. /Dev/null is a special device file, and any data it receives will be discarded. A null device is also known as a black hole because all the data here will not be returned.

Output redirection
Http://c.biancheng.net/cpp/view/2738.html for reference to this 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.