Marwan Ayman Shawky

Cloud & DevOps Engineer

Exploring the Linux Filesystem: A Map-Inspired Overview

·Calculating...·
linux

Brief

If you’re new to Linux, opening the terminal and running ls / can feel like stepping into a maze. There’s a /bin, /etc, /home, /var, /usr — but what do these mysterious folders mean?

The Linux filesystem is organized like a tree. Once you understand its structure, navigating Linux becomes simple and logical. In this guide, we’ll explore what lives where, why it’s structured this way, and how you can find what you need quickly.


The Filesystem Tree

Linux uses a single-root directory structure. Everything starts at / (root). All files, programs, devices, and even drives are located under this root.

Filesystem – Source: FutureLearn


Key Directories and Their Purpose

DirectoryWhat It StoresMore Info
/binCore commands (ls, cp, cat)Essential for system boot and repair. Avoid removing or altering.
/bootBootloader files, kernel, boot configsContains everything needed to start your OS. Critical for system startup.
/devDevices represented as files (/dev/sda)Lets you access and control hardware using standard file operations.
/etcSystem and application configuration filesEditing these changes how your system and services behave.
/homeUser directories and personal filesWhere each user’s documents, configs, and files are stored.
/libSystem libraries and kernel modulesRequired by essential binaries to run properly.
/mediaMount points for removable drivesExternal devices (USB, CD/DVD) auto-mount here.
/rootRoot user’s home directoryPersonal directory for the system administrator.
/sbinSystem binaries and admin commandsTools for managing the system, typically run by root.
/tmpTemporary files and cachesAutomatically cleared at reboot. Useful for temporary data.
/usrUser-installed software, docs, librariesMost programs and system-wide files live here.
/varLogs, spool files, cachesEssential for debugging, monitoring, and queues.

Challenge: Navigate and Explore Your Linux Filesystem

If you haven’t set up Linux in WSL2 yet, start with Part 1: Installing Linux on WSL2 so you can follow along.

Once you’re ready, open your terminal and try these steps:

1. See the Root of Your System

ls /

2. Peek Inside Key Folders

cd /bin && ls
cd /etc && ls
cd /var && ls
cd /home && ls

You should notice how:

  • /bin is full of executable files (commands)
  • /etc has configuration files
  • /home may only show your username
  • /var has subdirectories like log or cache

3. Check Directory Details

ls -lh /
  • This shows file sizes, permissions, and ownership
  • Question: Which folders are owned by root? Which ones are writable?

4. Find Where You Are

pwd
  • pwd (“print working directory”) shows your current location
  • Move around using cd and observe how pwd changes

Reflection

  • Which directory looks most important for system configuration?
  • Which one seems meant for users like you?
  • Did you find any folders that are empty?

The goal here is to get comfortable moving around and start recognizing patterns. Keep exploring step by step — Linux mastery is closer than you think!