/dev/zero

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Script error: No such module "Distinguish". Template:Short description Template:Use dmy dates Template:Mono is a special file in Unix-like operating systems that provides as many null characters (ASCII NUL, 0x00) as are read from it.[1] One of the typical uses is to provide a character stream for initializing data storage.[2]

Function

Read operations from Template:Mono return as many null characters (0x00) as requested in the read operation.

All write operations to Template:Mono succeed with no other effects. However, Template:Mono is more commonly used for this purpose.

When Template:Mono is memory-mapped, e.g., with mmap, to the virtual address space, it is equivalent to using anonymous memory; i.e. memory not connected to any file.

History

Template:Mono was introduced in 1988 in SunOS-4.0 to allow a mappable BSS segment for shared libraries using anonymous memory.[3] HP-UX 8.x introduced the MAP_ANONYMOUS flag for mmap(), which maps anonymous memory directly without a need to open Template:Mono.[4] Since the late 1990s, MAP_ANONYMOUS[5] or MAP_ANON are supported by most UNIX versions, removing the original purpose of Template:Mono.[6]

Examples

Erasing a file system partition or drive:

cp /dev/zero /dev/<destination drive or partition>

However, this may not perform a secure erasure, may not destroy the data at all, and may take significantly more time than required–for this purpose.

Creating a Script error: No such module "val". file, called foobar, filled with null characters:

Template:Sxhl

See also

References

<templatestyles src="Reflist/styles.css" />

  1. Script error: No such module "citation/CS1".
  2. Script error: No such module "citation/CS1".
  3. Script error: No such module "citation/CS1".
  4. Script error: No such module "citation/CS1".
  5. Script error: No such module "citation/CS1".
  6. Script error: No such module "citation/CS1".

Script error: No such module "Check for unknown parameters".