[ELI5] /dev/null, /dev/random, /dev/urandom and /dev/zero

840 views

I’ve been reading about this files and also I have tried to inspect by myself about this files (file, ll, Stat and some other commands) but I just don’t understand them.

Can someone please explain me what are these files and how can I used them?

In: Technology

8 Answers

Anonymous 0 Comments

Whenever you read from or write to a file, you don’t directly access the file. Instead, the operating system does that for you.

These three files are special in the sense that when you use them, the OS pretends they are real files when in fact they are “pretend” files.

When you try to write to /dev/null, the OS simply discards your input.

When you read from /dev/zero, the OS just gives you a bunch of zeroes.

And when you read from /dev/random, the OS just gives you a bunch of random numbers.

You are viewing 1 out of 8 answers, click here to view all answers.