/dev/zero |
In Unix-like operating systems, /dev/zero is a special file that provides as many null characters (ASCII NUL, 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.
dd if=/dev/zero of=/dev/hda7 #Initialise partition dd if=/dev/zero of=foobar count=1000 bs=1000 #Create large empty file
In contrast to /dev/null, which acts as a sink for data, /dev/zero acts as a source. All writes to /dev/null succeed with no other effects; all reads on /dev/zero return as many NULLs as read.
=See also=
*Unix philosophy *Standard streams *|
|