Describe the mknod command and when you’d use it.

Sharad Jaiswal
Written by Sharad Jaiswal

Posted On: Aug 26, 2018

 

    1 Answer Written

  •  Sharad Jaiswal
    Posted by jyothi

    The mknod command creates device special files or fifos.

    mknod was originally used to create the character and block devices that populate /dev/. Nowadays software like udev automatically creates and removes device nodes on the virtual filesystem when the corresponding hardware is detected by the kernel, but originally /dev was just a directory in / that was populated during install.

    So yes, in case of a near complete disaster causing the /dev virtual filesystem not to load and/or udev failing spectacularly, using mknod to painstakingly repopulate at least a rudimentary device tree to get something back up can be done... But yeah, that's sysadmin horror story time. Personally, I recommend a rescue USB stick or CD.

    Aside from creating named pipes, I can't think of a single possible day-to-day use for it that an end user would need to concern themselves with -- and even that is stretching the definition of 'day to day use'.

    Source: https://unix.stackexchange.com/questions/10723/what-is-the-mknod-command-used-for

Please Login or Register to leave a response.

Related Questions

Linux Interview questions

What is Linux? How is it different from UNIX?

Linux is free open source multi-user operating system that is built on Linux kernel. Linus Torvalds released the first..

Linux Interview questions

Compare Linux with Windows?

Here are some of the differences between Linux and windows:LinuxLinux is open source; the complete source code for L..

Linux Interview questions

What is a kernel?

The kernel is the core of any operating system. Kernel acts as a middleman between computer hardware and operating syst..

Ask a Question