On a UNIX system, everything is a file. If something is not a file, it is a process.
File extensions are meaningless. They are there for the user's sake.
Ubuntu is simply a collection (repository) of pre-compiled packages, running over a kernel (Big pile of software that knows how to make hardware do stuff).
Package = Plain text file > Compilation > Binary (.exe)
- Normal. Images, text, config...
- Directory. File pointing to files.
- Link. Shortcut/Redirect.
- Pipe. Use a process output as input for another.
- Character Device. Input/Output files Ex. Teminal.
- Block. Used for block devices. Ex. Hard Disk.
- Socket. Used for Interprocess Communication.
- Unix Socket. Local machine only (Superfast). Ex. Nginx communicates with a PHP interpreter.
- TCP Socket. Exposed to network (Slower). Ex. Nginx communicates with a website visitor.
Special files like sockets that allow processes to communicate with each other without dangerously sharing memory.
Sockets are files where processes can write stuff, and other processes can listen in real time.
- boot (bootloaders) - Everything the OS needs to boot.
- run (runtime) - Runtime information stored in RAM i.e. not written to disk.
- sys (system) - Interaction with the kernel. Similar to
run
, not written to disk. - proc (processes) - Pseudo files with information for system processes, created by the kernel. Every process has a directory named by the PID (process ID). Ex.
cat /proc/cpuinfo
gives CPU info.
- dev (devices) - Keyboard, mouse... - Other applications and drivers use this.
- sda - Hard disk (main).
sda1
would be a partition.
- sda - Hard disk (main).
- media (Device mounting - Automatic) - External hard drives, USBs.
- mnt (Device mounting - Manual)
- cdrom - Mounting point for CDs.
- bin (binaries) - Programs like
ls
,cat
,grep
... - sbin (system binaries) - Programs only admins use, single user mode.
- lib (libraries) - Used by
bin
andsbin
.
- etc (etcetera) - System wide cofiguration files.
- var (variable) - Files expected to grow in size, like logs, email databases, printer queues...
- usr - Applications installed and used by the user.
- opt (optional) - Manually installed software from other vendors.
- tmp (temp) - Temporary files ex. auto-saves.
- root - Home folder for root users.
- home. Home folders for each user, storing personal files.
- srv (service) - Web server files accessible by external users.
- snap - Self-contained Ubuntu apps.