7.7 File Manager Alternatives: ranger, nnn, mc

Look, I get it. You live in cd and ls. You’ve got your ls -la muscle memory so deeply ingrained you do it in your sleep. But sometimes, you need to actually get something done. You need to find a file buried in a labyrinth of directories, rename a batch of photos, or just see what’s chewing up all your disk space. For that, you need a proper file manager. Not the clunky GUI thing that came with your desktop environment, but a terminal-based one that respects your need for speed and doesn’t make you reach for the mouse.

7.6 Tree: Visualizing Directory Structure

Right, let’s talk about tree. If ls is a quick glance at your desk, tree is the full, organized blueprint of your entire office. It’s one of those utilities that seems almost frivolous until you use it once, and then you wonder how you ever lived without it. It recursively lists the contents of directories, displaying them in a, well, tree-like structure. It’s the fastest way to get the lay of the land in an unfamiliar project directory or to visualize the sprawling monstrosity you’ve created in your ~/Downloads folder.

7.5 Globbing: *, ?, [], and {} Brace Expansion

Right, let’s talk about making your shell do the heavy lifting. You’re not going to type out every single filename one by one, are you? Of course not. You’re smarter than that, and the shell is too. This is where “globbing” comes in—the process of using wildcard patterns to match filenames. It’s called globbing because of the original glob() function that handled it, and it’s one of those wonderfully simple yet powerful concepts that, once you master it, you’ll wonder how you ever lived without it.

7.4 Absolute vs Relative Paths: / and ..

Right, let’s settle this. The single biggest source of confusion and broken scripts when you’re starting out isn’t some complex algorithm—it’s simply not knowing where you are and how to tell the computer where you want to be. It all boils down to two ways of giving directions: absolute and relative. Think of it like giving someone your address. You could say, “It’s the big red house on 123 Main Street, Anytown, USA.” That works no matter where in the world you’re starting from. That’s an absolute path. It begins with a forward slash /, the root of the entire filesystem, and lists every single directory down to the target.

7.3 cd: Changing Directories and the - Shortcut

Right, let’s talk about cd. It’s the command you’ll use more than any other, the digital equivalent of putting one foot in front of the other. The concept is laughably simple: you tell your shell where you want to go, and it takes you there. The implementation, however, has a few quirks that have tripped up everyone from absolute beginners to grizzled veterans who just weren’t paying attention. Let’s demystify it.

7.2 ls: Listing Files with -l, -a, -h, -R, and --color

Right, let’s talk about ls. It’s the first command most of us learn, and consequently, the one we use wrong for the longest time. Typing ls by itself is like glancing into a room with the lights off. You get the vague shapes. But we’re not here for vague shapes. We’re here to see everything. Let’s turn on the lights. The default ls output is… fine. It’s a quick, alphabetical list. But the moment you need to know anything else—like who owns a file, how big it is, or when it was last modified—you’re left squinting. That’s where our flags come in. They’re not just options; they’re the difference between a glance and true sight.

7.1 pwd: Printing the Working Directory

Right, let’s start with the most brutally honest command in your arsenal: pwd. It stands for “print working directory,” and it does exactly one thing. It’s the command-line equivalent of you stopping in the middle of a hike, looking down at your boots, and declaring, “Yep, I am here.” It’s not glamorous, but my god, is it fundamental. You will use this more than you’ll use your backspace key, especially when you’re lost, which is a permanent state of being for anyone who’s actually getting stuff done.

— joke —

...