Explanation of/dev/null in Linux

Source: Internet
Author: User


In Linux, the explanation of/dev/null is in Linux/Unix. Generally, the information displayed on the screen is from stdout (standard output) or stderr (standard error output. Many people will ask why output is output and cannot be sent to the screen. Why should it be divided into stdout and stderr? This is because almost all programs run on the background in the server's working environment. Therefore, to facilitate debugging, when designing a program, send stdout to/to a file, and store the error information stderr to different files. Www.2cto.com is a normal output, for example, the time when the program starts running, and the number of people going online. Which are the wrong outputs? For example, you cannot find the URL you want to go to or fail to authenticate your credit card. With the above cognition, what is>/dev/null? This is to send stdout to/dev/null. What is/dev/null, /dev/null is in Unix/Linux [bottomless hole] www.2cto.com any output sent to [bottomless hole] and will no longer be. Believe me, it's really gone! So someone asked, under what circumstances should output be sent to this bottomless pit? There is no standard answer here, but in general, if you don't want to see too much output or output, it is possible that when the hard drive is congested, the program design will consider sending the output to/dev/null.
 

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.