1 What is a Linux black hole
In the Linux system,/dev/null is a fake device, commonly known as "Linux black Hole".
Any write to/dev/null succeeds, but the data disappears without any feedback, and the read-in data is empty.
2 Linux black Hole What's around
The information that you don't want to display on the screen is often sent to/dev/null, which is used more in shell scripts. This command must be used in conjunction with output redirection.
Such as:
will see the output of all users of the system thrown into the black hole:
<span style= "FONT-SIZE:24PX;" >ls/home >/dev/null</span>
Empty the contents of the file, Without deleting the file:
<span style= "FONT-SIZE:24PX;" >cat/dev/null > Your_file_name</span>
Note :
<span style= "FONT-SIZE:24PX;" >cat/dev/null > Your_file_name</span>
Command and
<span style= "FONT-SIZE:24PX;" >echo > Your_file_name</span> the
(reference: empast http://www.linuxdiyf.com/viewarticle.php?id=273259)
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Linux black Hole