Everything’s a File: The Linux Filesystem

Everything is a file: the Linux filesystem

You can move around now — the last post gave you pwd, ls and cd. But where are you moving around? Coming from Windows, the first surprise is what’s missing: there’s no C:, no D:, no drive letters at all. Everything — every disk, folder and file — hangs off a single tree that starts at /. Plug in a USB stick and it doesn’t become “drive E:”; it just appears somewhere on that one tree.

The filesystem is worth understanding for two reasons: knowing where things live — so you can find a config or a log without flailing, which is this post — and knowing who’s allowed to touch them, which is most of Linux security and earns a post of its own next time. Let’s get the lay of the land first.

The tree that matters

There’s an official map — the Filesystem Hierarchy Standard — but you don’t need all of it. A dozen directories do the day-to-day work:

flowchart LR
  ROOT["/ (the root of everything)"] --> ETC["/etc - config"]
  ROOT --> HOME["/home - user files"]
  ROOT --> VAR["/var - logs, changing data"]
  ROOT --> USR["/usr, /bin - programs"]
  ROOT --> DEV["/dev - devices"]
  ROOT --> PROC["/proc - live kernel/process info"]
  ROOT --> TMP["/tmp - scratch (wiped on reboot)"]
  HOME --> ME["/home/mitch - your ~"]

The ones you’ll actually visit: /etc is where configuration lives (nearly every “edit the config file” instruction points here); /home holds each user’s personal files (/home/mitch is your ~); /var is for data that changes — above all /var/log, the first place to look when something misbehaves; /usr and /bin hold installed programs; /tmp is scratch space wiped on reboot; and /dev and /proc are where it gets interesting…

Everything is a file

Here’s the idea that makes Unix Unix. That disk isn’t hidden behind some special interface — it’s a file, /dev/sda. Your running processes? Each is a little folder of files under /proc. Even things that aren’t really “files” at all are presented as files, so the same handful of tools work on absolutely everything.

Tidbit: no, really — everything

Want your CPU details? cat /proc/cpuinfo. Your memory? cat /proc/meminfo. That’s the same cat you’d point at a text file, here reading live kernel data as though it were one. Because the kernel exposes hardware and processes as files, you don’t need a special tool for each thing — ls, cat and redirection (>) work across the whole system. One interface, everything behind it.

Actually managing files

The console post gave you navigation; here are the verbs that change things. None of them has an undo, so read before you press Enter.

$ cp report.pdf backups/          # copy
$ mv draft.txt final.txt          # move OR rename
$ mkdir -p projects/2026/q3       # make folders, parents included
$ rm old.log                      # delete a file
$ rm -ri build/                   # delete a folder, asking first
$ ln -s /var/log/nginx logs       # a shortcut (symbolic link)

A couple of notes: mv is both “move” and “rename” (moving a file to the same folder under a new name is renaming it); -r means “recursive”, needed whenever you act on a directory and its contents; and -i makes destructive commands ask first — a good habit. Files whose names start with a dot (.bashrc, .ssh/) are simply hiddenls -a reveals them — and that’s where most of your personal configuration quietly lives.

The one-sentence version

One tree from /, with everything — disks, devices, even running processes — presented as a file on it. Know where things live, and a Linux machine stops feeling opaque and starts feeling navigable.

The file verbs here (cp, mv, rm and friends) have joined the Linux Cheatsheet. And the other half of the filesystem story — who’s allowed to touch all these files, and the chmod/chown machinery that decides — is meaty enough for a post of its own. That’s next: permissions.