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


Posted On: Feb 22, 2018


    1 Answer Written

  •  devquora
    Answered 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'.


Related Questions

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