8

I'm looking for some historic info about the null device. Why was it called /dev/null instead of (for example) /dev/empty?

FreeBSD's manual page states that "A null device appeared in Version 7 AT&T UNIX" but I can't find any reference or hint about why that name was originally chosen.

If it turns out that the name was originally used in a more ancient OS, I'd like to know how the original device worked and why that name was chosen.

  • /dev/null is one of very few pathnames standardized by POSIX. And even non-Unix-like systems call it that way (probably because Unix did it first). – Gilles 'SO- stop being evil' Dec 26 '16 at 22:59
  • 1
    @Gilles ok but why? What the history behind this specific name? – Giacomo Tesio Dec 27 '16 at 14:42
  • 2
    I've removed everything except the core question itself from here in the hope that that makes it clearer as a historical question; if I've interfered with what you wanted it to say please roll it back. – Michael Homer Dec 30 '16 at 21:40
  • 1
    The FreeBSD manual page is correct but somewhat misleading.  The null device, called /dev/null, was present in Version 6 Unix, in the mid 1970s.  (BTW, /dev/zero was added much later.) Unfortunately, I have no supporting evidence. – G-Man Says 'Reinstate Monica' Jan 1 '17 at 23:12
  • "on unix an "always blocking file" could be used to wait for signals." As it turns out, there's a system call that's used to wait for signals - pause(). – Mark Plotnick Jan 5 '17 at 15:52
4

null was chosen because it discards any data sent, pretty much like a void place. That's why its also called black hole.

It is a character device, a stream that has no connection to a real space in memory. Fun fact is that you can make your own personalized /dev/null with mknod -m 666 /dev/null c 1 3.

Additionally, it sends EOF if you try to read from it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.