In Linux, everything is treated as a file — regular files, folders, devices, all of it.
To check file types:
ls -l
The first character in the output tells you the file type.
| Symbol | File Type | Description |
|---|---|---|
- |
Regular File | Normal files — .txt, .sh, .log, binaries |
d |
Directory | Folders that organize files |
l |
Symbolic Link | Shortcut to another file or directory |
c |
Character Device | Transfers data character-by-character (keyboard, mouse, terminal) |
b |
Block Device | Transfers data in blocks (hard disk, SSD, USB) |
s |
Socket File | Enables process-to-process communication |
p |
FIFO / Named Pipe | Output of one process becomes input of another |
Regular File (-)
notes.txt, deploy.shDirectory (d)
/home, /etc, /varSymbolic Link (l)