Skip to main content

Command Palette

Search for a command to run...

The Linux Filesystem: The First Thing Every Beginner Must Understand

###Absolute vs. Relative Paths

Updated
4 min read
The Linux Filesystem: The First Thing Every Beginner Must Understand

If you're just starting with Linux, the terminal can feel intimidating. But once you understand how Linux organizes files, everything starts to make sense.

Today I want to explain one concept that changed how I see the terminal: the Linux Filesystem Hierarchy.


What Is a Filesystem?

A filesystem is simply how an operating system organizes and stores files. On Windows, you have drives like C:\ and D:\. On Linux, everything lives under one single root — written as /.

That single forward slash is the beginning of everything in Linux.


The Linux Filesystem Tree

Think of Linux like an upside-down tree:

/                  ← root (the top of everything)
├── home/          ← your personal files live here
│   └── abhijit/   ← your home directory
├── etc/           ← system configuration files
├── var/           ← logs and variable data
├── usr/           ← installed programs
├── bin/           ← essential commands (ls, cd, pwd...)
└── tmp/           ← temporary files

Every file and folder on a Linux system has an absolute path — a full address starting from /.

For example: /home/abhijit/notes.txt means:

  • Start at root /
  • Go into home/
  • Go into abhijit/
  • Find notes.txt

The 3 Commands That Navigate This Tree

These are the first three commands every Linux beginner learns — and they directly map to the filesystem concept above.

pwd — Print Working Directory

$ pwd
/home/abhijit

This tells you where you currently are in the filesystem tree. Think of it as "where am I right now?"

ls -la — List All Files

$ ls -la
drwxr-xr-x  abhijit  4096  Mar 20  .
drwxr-xr-x  root     4096  Mar 20  ..
-rw-r--r--  abhijit   220  Mar 20  .bashrc

Lists everything in your current location — including hidden files (files starting with .). The -l flag gives details, -a shows hidden files.

cd — Change Directory

$ cd /etc        # jump to system config folder
$ cd ~           # jump to your home folder
$ cd ..          # go up one level

This is how you move around the tree. ~ is shorthand for your home directory (/home/abhijit).


Key Terms to Remember

Term Meaning
/ Root — the top of the entire filesystem
~ Your home directory (e.g. /home/abhijit)
. Current directory
.. Parent directory (one level up)
Absolute path Full path from root e.g. /home/abhijit/file.txt
Relative path Path from where you currently are e.g. ../notes
Hidden file File starting with . — not shown by default

Why This Matters for Backend Engineers

As a backend developer, you'll spend a lot of time on Linux servers. Knowing the filesystem means you can:

  • Find config files in /etc/ to configure Nginx, PostgreSQL, or Docker
  • Check logs in /var/log/ when something breaks in production
  • Navigate to your project directory confidently without a GUI
  • Understand where installed packages live (/usr/local/bin/)

Every Docker container, every cloud server (AWS EC2, GCP, Azure) — they all run Linux. This is the foundation.


What I'm Using to Practice

I'm running WSL 2 (Windows Subsystem for Linux) with Ubuntu 22.04 on Windows. If you're on Windows and want to follow along, one command is all you need:

wsl --install

After a restart, you'll have a full Linux terminal inside Windows. Free, fast, and no dual boot required.


What's Next

In the coming days I'll be covering:

  • File permissions (chmod, chown)
  • Users and groups in Linux
  • Process management (ps, kill, top)
  • Shell scripting basics

Follow along if you're learning Linux too. — Abhijit