This question already has an answer here:

I just read the post here. It just said.

This statement is true because there are special files that are more than just files (named pipes and sockets, for instance), but to keep things simple, saying that everything is a file is an acceptable generalization. A Linux system, just like UNIX, makes no difference between a file and a directory, since a directory is just a file containing names of other files. Programs, services, texts, images, and so forth, are all files. Input and output devices, and generally all devices, are considered to be files, according to the system.

I think I just didn't understand it enough and well. and I didn't know how to understant it. How all the things in Linux(like device, process,net connection, program etc) are treated as a file? Could anyone ptell me more about this issue?

marked as duplicate by Jeff Schaller, Rui F Ribeiro, jimmij, slm linux Jun 26 '16 at 14:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


In order to truly understand, I'd recommend some reading about I/O operations in the C programming language. I find it easiest to understand that from a programming perspective when you deal with devices, socket, pipes, etc just as you do with files just like the Linux/Unix OSs do. Moreover you can read this value in wikipedia.


First of all, not all things are files. Process is not a file. But device is file. You can do read/write operations with devices. Also sockets can be bound to filesystem.



How I interpreted that (As I read a similar article) statement was that everything is controlled like a file. Meaning, unlike other Operating Systems, each file is shown and can be controlled. But I that's how I interpreted it.

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