Someone in Linux why always like to write/dev/null

Source: Internet
Author: User
=1 >/dev/null 2>&1 &
Why write in/dev/null here, I measured the next, input a.txt have something, but input to/dev/null view nothing AH

Reply content:

=1 >/dev/null 2>&1 &
Why write in/dev/null here, I measured the next, input a.txt have something, but input to/dev/null view nothing AH

/dev/null is a black hole, there is no in-out.
Primarily used to discard output information.

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

/dev/null is a black hole, and nothing will be lost when thrown in.
So make good use of/dev/null.

You understand that Dev/null is a junkyard, or a black hole, and nothing goes in. Position some unused output here and disappear ...

/dev/null is a special character device under Linux, which is mainly used to discard the output information, thus filtering out the error message, which helps to quickly find out the cause of the error.

This is the effect, when processing errors, the output from stderr is discarded into the file/dev/null. /dev/null is a special device file, and any data it receives will be discarded. A null device is also often called a black hole, because any data coming here will be gone.

Output redirection
You can refer to this article http://c.biancheng.net/cpp/view/2738.html

  • 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.