I deleted my /dev/null. How can I restore it?
mknod /dev/null c 1 3 chmod 666 /dev/null
Use these command to create
/dev/null or use
null(4) manpage for further help.
Under many traditional unices, you can recreate devices with their default permissions with the
MAKEDEV script. This script is traditionally in
/dev but is in
/sbin on Ubuntu. Pass it an argument that indicates what devices you want to create; on Ubuntu that's
std (you can write
MAKEDEV null as well, that creates
null as well as a number of other devices).
udevadm trigger --sysname-match=null