I have read that the /dev directory contains device files that points to device drivers.

Now my question is, is every single file in the /dev directory is a device file, or does the /dev directory contains other types of files?

  • Not necessarily. Some of those files are virtual devices. For instance pts, which emulate virtual terminals. ttys are virtual as well, unless it is interface for a serial connection with a development board like arduino May 27 '17 at 1:44
  • @Sergiy Kolodyazhnyy Files like /dev/tty1 and /dev/pts/0 are device files that points to device drivers, and the device drivers points to virtual devices like you said (but the idea is that /dev/tty1 and /dev/pts/0 are still considered to be device files even though they ultimately points to virtual devices).
    – John
    May 27 '17 at 2:29

Typically you may find (b)lock, (c)har, (s)ocket, (l)inks and (d)irectories in /dev. You can see the type with ls -l. However, depending on the OS, you may find other files in there. eg on NetBSD there is a shell script /dev/MAKEDEV, which is meant to help with the creation of these device entries.

As with your other question, it's the type of the file (first character of ls -l output) that determines if it's a device or not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.