Share on Facebook Share on Twitter Email
Answers.com

/dev/zero

 
Wikipedia: /dev/zero

In Unix-like operating systems, /dev/zero is a special file that provides as many null characters (ASCII NUL, 0x00) as are read from it. One of the typical uses is to provide a character stream for overwriting information. Another might be to generate a clean file of a certain size. Using mmap to map /dev/zero to the virtual address space is equivalent to using anonymous memory (not connected to any file).

Destroy data on a partition

#Do not execute this code on any computer unless you want to destroy all data on a partition!
dd if=/dev/zero of=/dev/<destination partition>

Create a 1MiB file filled with zeroes called 'foobar'

dd if=/dev/zero of=foobar count=1024 bs=1024

Like /dev/null, /dev/zero acts as a source and sink for data. All writes to /dev/zero succeed with no other effects (the same as for /dev/null, although /dev/null is the more commonly used data sink); all reads on /dev/zero return as many NULs as characters requested.

See also


Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
 
 

 

Copyrights:

Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "/dev/zero" Read more