0

In Linux, there is the /dev directory, which is a special directory which contains all of the files for devices and other things like random, urandom, etc.

Why did this directory exist? Was it just an artifact that never got removed from the Linux kernel (and couldn't really for compatibility)?

Justine Krejcha
  • 2,207
  • 2
  • 16
  • 27

2 Answers2

3

One of the philosophies in linux is that everything is a file, encoded or not, it is a special directory as you said. Linux, unlike windows is highly customizable and this is a way that the administrator has to create and manipulate devices and so on.

blade
  • 168
  • 1
  • 7
2

It exists to contains all of the files for devices and other things like random, urandom, etc.

Sparr
  • 1,121
  • 3
  • 10
  • 19
  • seriously, I don't know what you're looking for with this question. Where else would you put all of those things if not in /dev ? – Sparr Jun 01 '14 at 19:00
  • I guess for random, urandom, and some others it could be done with a call (that's what reading from these files does anyway if I'm not mistaken). – Justine Krejcha Jun 01 '14 at 19:04
  • @justcool393 requiring a call means you couldn't use command line file-manipulation tools to interact with the devices. being able to cat to a serial port, or grep /dev/mem, are very powerful capabilities. – Sparr Jun 02 '14 at 01:40
  • I get how being able to do that would be very useful. I guess I just wasn't use to it. – Justine Krejcha Jun 02 '14 at 04:27