Get AI summaries of any video or article — Sign up free
the Linux File System explained in 1,233 seconds // Linux for Hackers // EP 2 thumbnail

the Linux File System explained in 1,233 seconds // Linux for Hackers // EP 2

NetworkChuck·
5 min read

Based on NetworkChuck's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Linux represents commands, configuration, and devices as files arranged in a hierarchy, making system navigation and troubleshooting location-driven.

Briefing

Linux’s file system is built on one unifying idea: practically everything—configuration, devices, even command programs—is represented as files arranged in a predictable directory hierarchy. That framing matters because it turns “where do I find this?” and “how do I change this?” into navigable, repeatable tasks instead of guesswork.

The session starts at the root of the file system (/), then uses basic terminal commands to orient the learner: whoami to identify the current user, ls to list directory contents, pwd to show the current path, cd to move between directories, and clear (or Ctrl+L) to tidy the terminal. From there, the lesson expands into the core claim: commands like ls aren’t magic—they live as binaries stored in directories and can be inspected like files. By navigating to /bin (the “binaries” directory), the learner finds essential command binaries, including ls. Running cat ls prints the contents of the ls binary to the terminal, demonstrating that the command is indeed a file.

To make the file analogy concrete, the lesson performs file operations on command binaries. It uses cp to copy the ls binary into a new file (named “network chuck”), then executes that new file as a command—showing that copied binaries remain runnable. It also uses rm to remove the original ls binary, requiring elevated privileges via sudo when permissions block the action. After deleting ls, listing the directory no longer works until the binary is restored by copying the modified file back to ls. The takeaway is practical: Linux permissions and file locations directly control what commands exist and what actions succeed.

The directory structure then gets mapped. /bin holds essential user-facing commands, while /sbin (often “super binaries”) contains administrator-focused commands. The lesson also highlights that /usr contains its own bin and sbin directories that largely mirror /bin and /sbin, with overlap and historical reasons tied to storage and system layout. The which command is introduced as a way to determine which copy of a command will run (e.g., whether ls comes from /bin or /usr/bin).

Next comes a tour of major system directories and what they’re for: /boot contains boot files needed to start the system; /var stores logs and web/application-related data; /tmp holds temporary files; /lib provides shared libraries; and /home is where user accounts live (with root handled separately). The root user’s files are accessible under /root, but require sudo to inspect. Device files appear under /dev, where hard drives are represented as vda/vda1 in this environment; attempting to cat a device illustrates how raw device data can overwhelm a terminal, so Ctrl-C is used to stop it.

Finally, configuration files live under /etc. The lesson drills into networking by reading /etc/network/interfaces with sudo cat interfaces, where IP addresses and interface settings are stored. The tour closes with /media and /mnt, both used for mounting drives—/media for automatic mounting of removable media, and /mnt for manual mounting workflows. The session ends with a command-memorization and practice “homework” plan, emphasizing that knowing where things live in the FHS makes troubleshooting, configuring, and hacking far faster.

Cornell Notes

The file system lesson centers on a single rule: in Linux, nearly everything is a file—configuration data, device interfaces, and even command programs. Starting at /, learners use whoami, ls, pwd, cd, and clear to navigate and orient. The walkthrough proves commands are files by locating ls in /bin, printing it with cat, copying it with cp, deleting it with rm (using sudo when needed), and restoring it. It then maps key directories like /etc for configuration (including /etc/network/interfaces), /dev for devices (vda/vda1), and /home and /root for user data. Understanding these locations and how commands resolve (via which) makes system work and troubleshooting more predictable.

Why does the lesson insist that “everything is a file” in Linux, and how is that demonstrated?

It’s demonstrated by treating command binaries as ordinary files. The learner navigates to /bin, finds ls, and uses cat ls to dump its contents to the terminal—showing the command exists as a file. Then cp copies the ls binary into a new file name, and executing that new file runs the copied command. rm removes ls (with sudo due to permissions), breaking the ls command until it’s restored by copying the binary back.

What’s the practical difference between /bin, /sbin, and /usr/bin (and /usr/sbin)?

/bin holds essential command binaries for general use. /sbin contains administrator-focused commands. /usr/bin and /usr/sbin contain additional command binaries and often overlap with /bin and /sbin; the lesson notes that both locations can be “real” and that overlap is common. To determine which one runs, it introduces which, since PATH resolution decides the effective command location.

How does which help when multiple copies of a command exist?

which reports the path of the command binary that will be executed. The lesson uses which ls and which cat to show they can come from /usr/bin (and similarly for other commands). It also uses which network chuck to confirm the copied binary is being found and run from its location. This matters when troubleshooting because behavior can differ if different binaries are being invoked.

Where are system configuration and networking settings stored, and how does the lesson read them?

Configuration lives under /etc. For networking, the lesson focuses on /etc/network/interfaces and reads it with sudo cat interfaces. That file contains network interface definitions and their assigned IP addresses, and the lesson notes that editing it was a common approach on many systems (even if modern Linux setups may differ).

What do /dev and /etc represent, and why does catting a device behave differently than catting a file?

/dev represents devices as special files. The lesson inspects /dev and points to vda and vda1 as hard drives in this environment. When it tries sudo cat vda, the terminal floods with raw device data (binary “gobbledygook”), so Ctrl-C is used to stop it. In contrast, catting a normal file like /etc/network/interfaces outputs readable configuration text.

How do /media and /mnt differ in mounting drives?

Both are used for mounting drives, but the lesson frames their typical roles: /media is mainly for automatic mounting of removable media like USB flash drives, while /mnt is used for mounts that may be done manually using mount commands. In both cases, the mounted drive becomes accessible through the file system as a directory entry.

Review Questions

  1. If ls is deleted from /bin, what commands and steps would restore it in this lesson’s workflow?
  2. How would you use which to verify whether a command is coming from /bin or /usr/bin?
  3. What files would you inspect to troubleshoot Linux networking settings according to the lesson, and why is sudo required?

Key Points

  1. 1

    Linux represents commands, configuration, and devices as files arranged in a hierarchy, making system navigation and troubleshooting location-driven.

  2. 2

    The core navigation toolkit is whoami, ls, pwd, cd, and clear, starting from / (root) to map the system.

  3. 3

    Command binaries live in directories like /bin and /sbin; they can be inspected and manipulated like files using cat, cp, and rm.

  4. 4

    Permissions often block file operations on system binaries; sudo enables privileged actions for specific commands.

  5. 5

    Multiple copies of commands can exist under /bin and /usr/bin; which reveals which binary will actually run.

  6. 6

    Key directories follow consistent roles: /etc for configuration, /dev for devices, /home for user data, /root for the root user, and /var for logs and application data.

  7. 7

    Mount points like /media and /mnt provide file-system access to drives, with /media typically handling automatic removable mounts and /mnt supporting manual mounting.

Highlights

The ls command is not “special”—it’s a binary file in /bin that can be copied, deleted, and restored, directly affecting whether ls works.
Deleting /bin/ls breaks the ls command until the binary is restored with cp, illustrating how tightly command availability ties to file locations.
Networking settings are read from /etc/network/interfaces, where interface names and IP assignments live.
Device nodes under /dev (like vda/vda1) behave like files, but catting them can overwhelm the terminal—Ctrl-C becomes necessary.
which is the practical tool for resolving command ambiguity when the same command exists in multiple directories (e.g., /bin vs /usr/bin).

Topics

  • Linux File System Hierarchy
  • Command Binaries as Files
  • Permissions and sudo
  • Key Directories (/etc,/dev,/home)
  • Mount Points (/media,/mnt)