null(4)

✨ NAME ✨

okay bestie, meet null and zero β€” they're the data sink πŸ’… this is null(4), aka the kernel interfaces manual page for the two most unbothered devices in all of Linux 🫢


🌸 DESCRIPTION 🌸

Anything you write to the special files /dev/null and /dev/zero? gone. literally just discarded, no thoughts, head empty, bye πŸ‘‹βœ¨

But the reads? that's where they're not the same, and this is the part you gotta remember:

  • Reads from /dev/null always return end of file β€” meaning read(2) returns 0 😌 it's giving "i have nothing for you and i will never have anything for you."
  • Reads from /dev/zero always return bytes containing zero (those '\0' characters) β€” so it will happily keep handing you zeros forever, it never runs out 🌈

These devices are typically created by:

mknod -m 666 /dev/null c 1 3
mknod -m 666 /dev/zero c 1 5
chown root:root /dev/null /dev/zero

copy those exactly, no cap πŸŽ€


πŸŽ€ FILES πŸŽ€

  • /dev/null
  • /dev/zero

πŸ’œ NOTES πŸ’œ

⚠️ If these devices are not writable and readable for all users, many programs will act strangely. like, strangely strangely. bestie do not skip the permissions on this one, it's the whole vibe check πŸ™ˆ

Also, important lore: since Linux 2.6.31, reads from /dev/zero are interruptible by signals πŸ¦‹ (this change was made to help with bad latencies for large reads from /dev/zero) β€” so yeah, the kernel fixed that for us, iconic behavior honestly πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page, bestie πŸ’– this was Linux man-pages 6.20, dated 2025-05-17 β€” go forth and pipe things into the void, mwah πŸ“πŸ§šβœ¨

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: GPL-2.0-or-later
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms