APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2003/11/20 mknod

Make special files. Obviously this (the underlying system call, actually) gets used a lot in /dev, but there are other uses. I often use this to make a device file for printing to (see How can I make a device that will print to a network printer?), and the same general idea is useful for other schemes. I've used it to let a non-privileged user send commands to a root process - the user writes to the named pipe, and a root process reads it and acts appropriately (you wouldn't want to literally execute whatever the user writes - you would do this for a specific purpose, such as copying data written to a file in a protected directory, etc.).

On some systems there is a specific "mkfifo" command; mknod is more general purpose.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> mknod - Make special files.

Increase ad revenue 50-250% with Ezoic

More Articles by

Find me on Google+

© Tony Lawrence

mkfifo exists in SCO OSR5 and may be used to create a named pipe (FIFO). It has the syntax:

mkfifo [-m] pathname

The -m option may be used to set the permissions on the newly-created fifo. For example:

mkfifo -m 666 /dev/mypipe


Kerio Samepage

Have you tried Searching this site?

Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Today, kernels are too much obedient servants, blindly doing the bidding of any program that asks. (Tony Lawrence)

This post tagged: