Null device

Last updated

In some operating systems, the null device is a device file that discards all data written to it but reports that the write operation succeeded. This device is called /dev/null on Unix and Unix-like systems, NUL: (see TOPS-20) or NUL on CP/M and DOS (internally \DEV\NUL), nul on OS/2 and newer Windows systems [1] (internally \Device\Null on Windows NT), NIL: on Amiga operating systems, [2] and NL: on OpenVMS. [3] In Windows Powershell, the equivalent is $null. [4] It provides no data to any process that reads from it, yielding EOF immediately. [5] In IBM operating systems DOS/360 and successors [lower-alpha 1] and also in OS/360 and successors [lower-alpha 2] such files would be assigned in JCL to DD DUMMY.

Contents

In programmer jargon, especially Unix jargon, it may also be called the bit bucket [6] or black hole.

History

/dev/null is described as an empty regular file in Version 4 Unix. [7]

The Version 5 Unix manual describes a /dev/null device with modern semantics. [8]

Usage

The null device is typically used for disposing of unwanted output streams of a process, or as a convenient empty file for input streams. This is usually done by redirection.

The /dev/null device is a special file, not a directory, so one cannot move a whole file or directory into it with the Unix mv command.

References in computer culture

This entity is a common inspiration for technical jargon expressions and metaphors by Unix programmers, e.g. "please send complaints to /dev/null", "my mail got archived in /dev/null", and "redirect to /dev/null"—being jocular ways of saying, respectively: "don't bother sending complaints", "my mail was deleted", and "go away". The iPhone Dev Team commonly uses the phrase "send donations to /dev/null", meaning they do not accept donations. [9] The fictitious person name "Dave (or Devin) Null" is sometimes similarly used (e.g., "send complaints to Dave Null"). [10] In 1996, Dev Null was an animated virtual reality character created by Leo Laporte for MSNBC's computer and technology TV series The Site . Dev/null is also the name of a vampire hacker in the computer game Vampire: The Masquerade – Redemption. A 2002 advertisement for the Titanium PowerBook G4 reads The Titanium Powerbook G4 Sends other UNIX boxes to /dev/null. [11]

The null device is also a favorite subject of technical jokes, [12] such as warning users that the system's /dev/null is already 98% full. The 1995 April Fool's issue of the German magazine c't reported on an enhanced /dev/null chip that would efficiently dispose of the incoming data by converting it to a flicker on an internal glowing LED.

Dev/Null is also the name of an electronic dance music producer and jungle DJ. [13]

See also

Notes

  1. The most recent being z/VSE.
  2. The most recent being z/OS.

Related Research Articles

fsck System tool for checking the consistency of a file system

The system utility fsck is a tool for checking the consistency of a file system in Unix and Unix-like operating systems, such as Linux, macOS, and FreeBSD. The equivalent programs on MS-DOS and Microsoft Windows are CHKDSK, SFC, and SCANDISK.

AmigaDOS is the disk operating system of the AmigaOS, which includes file systems, file and directory manipulation, the command-line interface, and file redirection.

dir (command) Directory information command on various operating systems

In computing, dir (directory) is a command in various computer operating systems used for computer file and directory listing. It is one of the basic commands to help navigate the file system. The command is usually implemented as an internal command in the command-line interpreter (shell). On some systems, a more graphical representation of the directory structure can be displayed using the tree command.

pwd Directory information command on various operating systems

In Unix-like and some other operating systems, the pwd command writes the full pathname of the current working directory to the standard output.

A home directory is a file system directory on a multi-user operating system containing files for a given user of the system. The specifics of the home directory are defined by the operating system involved; for example, Linux / BSD (FHS) systems use /home/⟨username⟩ or /usr/home/⟨username⟩ and Windows systems since Windows Vista use \Users\⟨username⟩.

Peripheral Interchange Program (PIP) was a utility to transfer files on and between devices on Digital Equipment Corporation's computers. It was first implemented on the PDP-6 architecture by Harrison "Dit" Morse early in the 1960s. It was subsequently implemented for DEC's operating systems for PDP-10, PDP-11, and PDP-8 architectures. In the 1970s and 1980s Digital Research implemented PIP on CP/M and MP/M.

A virtual device in Unix is a file such as /dev/null or /dev/urandom, that is treated as a device, as far as user level software is concerned, but is generated by the kernel without reference to hardware.

<span class="mw-page-title-main">Daemon (computing)</span> Computer program that runs as a background process

In multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user. Traditionally, the process names of a daemon end with the letter d, for clarification that the process is in fact a daemon, and for differentiation between a daemon and a normal computer program. For example, syslogd is a daemon that implements system logging facility, and sshd is a daemon that serves incoming SSH connections.

In computers, a printer driver or a print processor is a piece of software on a computer that converts the data to be printed to a format that a printer can understand. The purpose of printer drivers is to allow applications to do printing without being aware of the technical details of each printer model.

<span class="mw-page-title-main">DIGITAL Command Language</span> Command language adopted by several operating systems (OSs)

DIGITAL Command Language (DCL) is the standard command language adopted by many of the operating systems created by Digital Equipment Corporation. DCL had its roots in IAS, TOPS-20, and RT-11 and was implemented as a standard across most of Digital's operating systems, notably RSX-11 and RSTS/E, but took its most powerful form in VAX/VMS. DCL continues to be developed by VSI as part of OpenVMS.

In Unix-like operating systems, find is a command-line utility that locates files based on some user-specified criteria and either prints the pathname of each matched object or, if another action is requested, performs that action on each matched object.

In computing, a temporary folder or temporary directory is a directory used to hold temporary files. Many operating systems and some software automatically delete the contents of this directory at bootup or at regular intervals, leaving the directory itself intact.

In computing, tee is a command in command-line interpreters (shells) using standard streams which reads standard input and writes it to both standard output and one or more files, effectively duplicating its input. It is primarily used in conjunction with pipes and filters. The command is named after the T-splitter used in plumbing.

strings (Unix)

In computer software, strings is a program in Unix, Plan 9, Inferno, and Unix-like operating systems that finds and prints the strings of printable characters in files. The files can be of regular text files or binary files such as executables. It can be used on object files and core dumps. strings is mainly useful for determining the contents of non-text files.

del (command) Command in various operating systems

In computing, del is a command in command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS, NDOS, 4OS2, 4NT and Windows PowerShell. It is used to delete one or more files or directories from a file system.

copy (command)

In computing, copy is a command in various operating systems. The command copies computer files from one directory to another.

In Unix-like operating systems, a device file or device node or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These special files allow an application program to interact with a device by using its device driver via standard input/output system calls. Using standard system calls simplifies many programming tasks, and leads to consistent user-space I/O mechanisms regardless of device features and functions.

<span class="mw-page-title-main">AmigaOS</span> Operating system for Amiga computers

AmigaOS is a family of proprietary native operating systems of the Amiga and AmigaOne personal computers. It was developed first by Commodore International and introduced with the launch of the first Amiga, the Amiga 1000, in 1985. Early versions of AmigaOS required the Motorola 68000 series of 16-bit and 32-bit microprocessors. Later versions were developed by Haage & Partner and then Hyperion Entertainment. A PowerPC microprocessor is required for the most recent release, AmigaOS 4.

<span class="mw-page-title-main">DOS</span> Family of IBM PC-compatible operating systems

DOS is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible systems from other manufacturers include DR-DOS (1988), ROM-DOS (1989), PTS-DOS (1993), and FreeDOS (1998). MS-DOS dominated the IBM PC compatible market between 1981 and 1995.

<span class="mw-page-title-main">Unix filesystem</span> Directory structure used by a Unix-like operating system

In Unix and operating systems inspired by it, the file system is considered a central component of the operating system. It was also one of the first parts of the system to be designed and implemented by Ken Thompson in the first experimental version of Unix, dated 1969.

References

  1. "Redirecting Error Messages from Command Prompt: STDERR/STDOUT". support.microsoft.com. Retrieved 2020-03-06.
  2. Commodore-Amiga, Inc. (1986). The AmigaDOS Manual. Bantam Books. p. 12. ISBN   0-553-34294-0.
  3. "OpenVMS Programming Concepts Manual". h30266.www3.hpe.com. Archived from the original on 2020-07-02. Retrieved 2020-03-06.
  4. SteveL-MSFT. "about_Automatic_Variables - PowerShell". docs.microsoft.com. Retrieved 2020-03-06.
  5. "Single Unix Specification Section 10.1: Directory Structure and Files". The Open Group. Retrieved 2012-11-29.
  6. "bit bucket". Jargon File. Retrieved 2013-12-27.
  7. Thompson, K.; Ritchie, D. M. (November 1973). UNIX Programmer's Manual, Fourth Edition. Bell Telephone Laboratories, Inc. sh (I) (./man1/sh.1). Online at TUHS.
  8. Thompson, K.; Ritchie, D. M. (June 1974). UNIX Programmer's Manual, Fifth Edition (PDF). Bell Telephone Laboratories, Incorporated. mem (IV).
  9. "Dev-Team Blog - Donations to /dev/null". 2015-09-07. Archived from the original on 2015-09-07. Retrieved 2018-11-15.
  10. Goodman, Danny (2004). Spam Wars: Our Last Best Chance to Defeat Spammers, Scammers, and Hackers. New York: SelectBooks. p. 170. ISBN   9781590790632. OCLC   1036874851.
  11. "Image: unixad.jpg, (1094 × 720 px)". Archived from the original on 2013-03-26. Retrieved 2015-09-02.
  12. "The FreeBSD Funnies". Freebsd.org. Retrieved 2012-11-28.
  13. "Dev Null Microjunglizm". The New Yorker. Retrieved 2024-01-24.