Type of files in Linux / Unix

General support questions including new installations
Post Reply
sandeeppowar
Posts: 15
Joined: 2015/09/23 14:16:41

Type of files in Linux / Unix

Post by sandeeppowar » 2015/09/23 14:28:40

HEllo,

There are 7 types of file in Linux/Unix which are mention below :

1) Regular file(-)
2) Directory files(d)
3) Block file(b)
4) Character device file(c)
5) Named pipe file or just a pipe file(p)
6) Symbolic link file(l)
7) Socket file(s)

Any other is there ?

aks
Posts: 3073
Joined: 2014/09/20 11:22:14

Re: Type of files in Linux / Unix

Post by aks » 2015/09/23 15:59:23

Many.
Well it depends on what you mean by "type". For example a JPG file is a JPG type of file. That data is contained in the "magic bytes" in the header of the file.

MartinR
Posts: 714
Joined: 2015/05/11 07:53:27
Location: UK

Re: Type of files in Linux / Unix

Post by MartinR » 2015/09/23 16:25:52

Checking the man page for find(1):
-type c
File is of type c:

b block (buffered) special

c character (unbuffered) special

d directory

p named pipe (FIFO)

f regular file

l symbolic link; ...

s socket

D door (Solaris)

So you are correct for Linux but in the wider UNIX family there is Solaris' door type.

Post Reply