According with the FHS
about /dev
at:
it contains:
The following devices must exist under /dev.
/dev/null
All data written to this device is discarded. A read from this device will return an EOF condition.
/dev/zero
This device is a source of zeroed out data. All data written to this device is discarded. A read from this device will return as many bytes containing the value zero as was requested.
...
Observe that both have:
All data written to this device is discarded
I read many tutorials where /dev/null
is always used to discard data. But because both have the same purpose about writing (discard)
Question
- When is mandatory use
/dev/zero
over/dev/null
for write/discard purpose?
BTW for other differences - practically mostly about read - we have available:
null
but haszero
, I guess.)