/dev/zero
From Wikipedia, the free encyclopedia
In Unix-like operating systems, /dev/zero is a special file that provides as many null characters (ASCII NULL, 0x00; not ASCII character "digit zero", "0", 0x30) 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 RAM is the BSD way of implementing shared memory.
# Initialise partition (important note: trying out this command will eradicate # any files that were on the partition, make sure you have a backup of any important data.) dd if=/dev/zero of=/dev/hda7
# Create a large empty file called 'foobar' dd if=/dev/zero of=foobar count=1000 bs=1000
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.