Linux File System Basics

What You'll Learn

Every Linux system organizes files and folders in a single tree starting at / (called "root"). Unlike Windows with C:\, D:\ drives, Linux uses one unified hierarchy. This guide explains the most important directories so you know where everything lives.

The Root Directory Structure

Type ls / to see all top-level folders. Here's what each one does:

DirectoryPurpose
/binEssential command binaries (ls, cp, grep) — available to all users.
/etcConfiguration files for the system and applications.
/homeUser home directories. Your files live in /home/yourusername.
/varVariable data — logs (/var/log), mail, caches.
/tmpTemporary files. Cleared on reboot.
/usrUser programs and libraries — the largest directory on most systems.
/optOptional/add-on software packages (e.g., Google Chrome, Slack).
/rootThe root user's home directory. You need sudo to access it.
/devDevice files — hardware is represented as files here.
/procVirtual filesystem showing process and kernel information in real time.
/sysAnother virtual filesystem for kernel and device parameters.

Hidden Files and Dotfiles

Any file or folder starting with a dot (.) is hidden by default. These usually store configuration for your user:

Show them with: ls -a ~

Troubleshooting

What's Next?

Now that you understand the file system layout, learn the essential commands every beginner needs:

Your First Linux Commands →