Search notes:

/dev/null

POSIX requires /dev/null to be «an empty data source and infinite data sink».
Thus,

Recreating /dev/null

The following mv command overwrites /dev/null:
$ sudo mv a-file /dev/null
Now, /dev/null is not the special device file anymore.
It can be recreated again by first deleting the ordinary file whose name now is /dev/null
$ sudo rm /dev/null
… and then recreating it like so:
$ sudo mknod -m 0666 /dev/null c 1 3

See also

man 4 null
/dev/zero
/dev
Apparently, /dev/null is created in drivers/char/mem.c.

Index