█
LastWrite
  • > Curriculum
  • > Pricing
  • > For Educators
  • > About
  • > Contact
Log InGet Started

Questions, concerns, bug reports, or suggestions? We read every message, write to us at [email protected].

More ways to reach us →
LastWrite

Structured computer science lessons for aspiring developers and security professionals.

[email protected]

(201) 785-7951

Mon–Fri, 9 AM–5 PM EST

Learn

  • Curriculum
  • Pricing

Company

  • About
  • For Educators & Schools
  • Contact Us

Legal

  • Terms of Service
  • Privacy Policy
© 2026 LastWrite. All rights reserved.
Curriculum/DevOps and Infrastructure/Linux and the Command Line/The Linux Filesystem
30 minBeginner

The Linux Filesystem

After this lesson, you will be able to: Navigate the Linux filesystem confidently, directories, absolute vs relative paths, and the 'everything is a file' philosophy.

Most of the cloud runs Linux. If you're going to deploy, debug, or operate a real system, the Linux shell is the place you do it. This lesson is the foundation.

This is a free introductory lesson. No purchase required.

Why Linux, and the distro landscape

Linux runs most of the world's servers, nearly every cloud instance, the inside of almost every container, and Android phones. If you operate software in production, you operate it on Linux, which is why this subtrack is the prerequisite for the rest of the track. A 'distribution' (distro) bundles the Linux kernel with tools and a package manager. You will mostly meet three: Ubuntu (and its Debian base) is the default for servers and what this track uses; Alpine is a tiny distro built for containers, so Docker images are often Alpine-based; Kali is a security-focused distro loaded with pentest tools, used in the Cybersecurity track. The commands you learn here transfer across all of them; mainly the package manager differs.

The Linux directory tree

Everything starts at `/` (the root). `/home/<user>` is your home directory (also written `~`). `/etc` holds system-wide configuration files. `/var` holds variable data (logs, mail, databases). `/usr` holds user-installed programs and shared data. `/tmp` is scratch space cleared on reboot. `/bin`, `/sbin`, `/usr/bin` hold executables. Memorise this tree; you'll reference it for the rest of your career.

Absolute vs relative paths

Absolute path starts with `/`: `/home/alex/code/api/src/main.ts`. Unambiguous everywhere. Relative path is relative to your current directory (cwd): `code/api` if you're in `/home/alex`. Shorter to type. Special shortcuts: `.` = current dir, `..` = parent dir, `~` = home dir, `-` = previous dir. Use `pwd` to see your current dir; `cd ~` to jump home; `cd -` to flip back.

ℹ️ Everything is a file

In Linux, directories, processes, devices, network sockets, all appear as files. `/proc/cpuinfo` is a virtual file you can `cat` to see CPU details. `/dev/null` is a sink (write to it = discard). `/dev/sda` is the first hard drive. This abstraction is what makes the shell so powerful: every tool reads and writes files, so they compose with pipes.

Your first 5 minutes in a Linux shell

These commands let you orient anywhere on any Linux box.

tsx
pwd # print working directory
ls # list files in current dir
ls -la # list ALL files (including dotfiles), long format
cd /var/log # change directory (absolute)
cd .. # up one level
cd ~ # jump to home
whoami # which user am I
uname -a # OS + kernel version
df -h # disk usage, human-readable
free -h # memory usage

Common mistakes only experienced users avoid

Trying to operate without `pwd` and `ls`. You'll delete the wrong file. Memorising commands without understanding what they do. Type `<command> --help` or `man <command>` for the docs. Treating Linux like Windows. Forward slashes only; case-sensitive file names. Editing files in `/etc` without making a backup first. `sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak` is muscle memory.

Quick Check

Which directory holds system-wide configuration files on most Linux distros?

Pick the canonical location.

Back to Linux and the Command Line
Essential Commands→