/dev/null

noun

say it: “dev NULL” /dɛv ˈnʌl/

A special file on Linux and macOS that throws away everything written into it.

What is /dev/null?

/dev/null (read "dev null") is a special file that throws away everything written into it and always reads as empty. Send output you don't want there: 2> /dev/null hides a command's error messages and keeps its real results on the screen.

find /etc -name os-release 2> /dev/null
# /etc/os-release

In a sentence

  • “Anything written into /dev/null is gone at once, and reading it gives nothing back.”
  • “Diego sent find's error messages to /dev/null so only the file he was looking for was left on the screen.”

Level: Apprentice · More Unix terms at this level

Updated