aboutsummaryrefslogtreecommitdiffstats
path: root/man/man4/null.4
blob: c98da4a86bf21c445d4ad6860167b698adae38ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" SPDX-License-Identifier: GPL-2.0-or-later
.\"
.TH null 4 (date) "Linux man-pages (unreleased)"
.SH NAME
null, zero \- data sink
.SH DESCRIPTION
Data written to the
.I /dev/null
and
.I /dev/zero
special files is discarded.
.P
Reads from
.I /dev/null
always return end of file (i.e.,
.BR read (2)
returns 0), whereas reads from
.I /dev/zero
always return bytes containing zero (\[aq]\[rs]0\[aq] characters).
.P
These devices are typically created by:
.P
.in +4n
.EX
mknod \-m 666 /dev/null c 1 3
mknod \-m 666 /dev/zero c 1 5
chown root:root /dev/null /dev/zero
.EE
.in
.SH FILES
.I /dev/null
.br
.I /dev/zero
.SH NOTES
If these devices are not writable and readable for all users, many
programs will act strangely.
.P
Since Linux 2.6.31,
.\" commit 2b83868723d090078ac0e2120e06a1cc94dbaef0
reads from
.I /dev/zero
are interruptible by signals.
(This change was made to help with bad latencies for large reads from
.IR /dev/zero .)
.SH SEE ALSO
.BR chown (1),
.BR mknod (1),
.BR full (4)