How to create /dev/null?

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).

Under modern Linux systems running udev, you can tell udev to recreate all or some devices based on available drivers and connected hardware, through udevadm trigger:

udevadm trigger --sysname-match=null

Tags:

Linux

Devices