Finding Your Feet at the Console

Finding your feet at the Linux console

At the end of the last post I left you installing a distro (or firing up WSL), and warned you’d end up right here: a screen with nothing on it but mitch@server:~$ and a blinking cursor. No windows, no icons, no reassuring buttons. It’s the moment most people quietly back away.

Don’t. That prompt isn’t a void — it’s an invitation, and it’s already telling you more than you’d think. Let’s turn it from intimidating into a conversation you can hold, and pick up enough commands to look thoroughly competent on a machine you’ve never seen before.

What you’re actually looking at

Three things are in the room, and it helps to keep them straight. The kernel is Linux proper — the part that actually drives the hardware: CPU, memory, disks, devices. You never speak to it directly. Instead you speak to a shell — a program whose entire job is to read what you type, find the right program, run it, and hand you the result. And then there’s you, giving the orders.

flowchart TD
  YOU["You — type a command"] --> SH["Shell — reads it, runs the program"]
  SH --> K["Kernel — drives CPU, memory, disks, devices"]
  K --> HW["The hardware"]

So you’re not “in Linux” the way you’re in an app — you’re holding a conversation with a very literal-minded assistant: you say a word, it runs the matching program, it reports back, and waits for the next word. Nothing you type is magic; it’s all just asking the shell to run something.

Note: your prompt is already talking to you

That mitch@server:~$ isn’t decoration. Read it left to right: mitch is who you’re logged in as, server is which machine you’re on (well worth checking before you type anything destructive), ~ is where you are — shorthand for your home directory — and the $ means the shell is ready for orders. See a # there instead of $? You’re root — tread carefully.

A command is just a program (with arguments)

Every command follows the same little grammar, and once you see it nothing looks cryptic again. Take ls -la /etc: that’s the program ls (list), the options -la (long format, and all files including hidden ones), and the target /etc (where to look). The shape is always command [options] [arguments]. Commands aren’t secret incantations to be memorised — they’re small programs, each doing roughly one thing well, that you combine. Learn the grammar and every new command is just vocabulary.

Moving around

You navigate with three verbs and a few shorthands. pwd tells you where you are; ls shows what’s here; cd moves you. The shorthands: / is the very top (root), ~ is your home, . is “here”, and .. is “up one”.

$ pwd
/home/mitch
$ ls -la
drwxr-xr-x 3 mitch mitch 4096 Jul 27 09:14 .
-rw-r--r-- 1 mitch mitch  220 Jul 27 09:10 .bash_logout
drwxr-xr-x 2 mitch mitch 4096 Jul 27 09:12 projects
$ cd projects && pwd
/home/mitch/projects

That’s genuinely enough to move around any Linux machine with confidence. (Copying, moving and deleting files — and the permissions that govern them — earn a post of their own next.)

You look it up — you don’t memorise it

Here’s the single most reassuring thing about all of this: nobody keeps every command and flag in their head. They look them up, every day, without a shred of shame.

Tip: help is always a keystroke away

Stuck on a command? man <command> opens its full manual (press q to leave). Want the short version? Almost everything answers <command> --help. And if the manual reads like a legal contract, tldr <command> (once installed) gives you the handful of real-world examples you actually wanted. Looking things up isn’t cheating — it is the job.

Reading a strange box in thirty seconds

Here’s where it pays off. You’ll often land on a machine you’ve never met — a server, a customer’s box, something you SSH’d into half-asleep — and the first move is to look before you leap. A few read-only commands tell you almost everything:

$ whoami                 # who am I?
mitch
$ hostnamectl            # what IS this box?
 Static hostname: web-01
 Operating System: Ubuntu 24.04.1 LTS
$ df -h /                # is the disk full?
Filesystem  Size  Used Avail Use% Mounted on
/dev/sda1    40G   18G   21G  47% /
$ ps aux --sort=-%mem | head -3   # what's hungry?

Who am I and what can I do (whoami, id); what is this box (hostnamectl, uname -a); what’s running and eating resources (ps aux, top); is the disk or memory in trouble (df -h, free -h); and what has it been complaining about (journalctl -xe, or a poke around /var/log). None of these change a thing — they just get you your bearings before you touch anything.

That’s a lot of commands to land at once, which is exactly why they’ve got a permanent home: the Linux Cheatsheet keeps this lot (and more) in one place, so you never have to remember which post they were in.

Stopping things (and not setting fire to anything)

Two keystrokes will save you more often than any command. Ctrl-C interrupts whatever’s currently running — your escape hatch when something’s spewing output or has hung. Ctrl-D signals “I’m done” — it ends input, and at an empty prompt it logs you out. And the eternal beginner’s trap, being stuck inside a text editor: vim lets you out with :q! then Enter; nano with Ctrl-X. (Everyone has been trapped in vim at least once. Everyone.)

Warning

The shell does exactly what you tell it, instantly, with no undo. sudo runs a command as all-powerful root, and rm -rf deletes without a flicker of hesitation — the two together, aimed at the wrong path, are how people wipe production. Read the command before you press Enter, keep sudo for the moments you genuinely need it, and never let living-as-root become a habit. Respect the sharp tools and they’ll serve you well.

The one-sentence version

The shell is a conversation: a prompt that quietly tells you who and where you are, commands that are just small programs following command [options] arguments, and help forever a keystroke away. Poke around read-only, look before you leap, and treat the sharp commands with respect.

One more thing. Everything above, we did sat right in front of the machine — but out in the real world you almost never are. You’re at your desk, reaching a box in a rack across town (or a continent) over an encrypted connection. How that works — securely, and why it’s the single most useful trick a field tech can own — is a story of its own, coming to the Tech Toolbox: SSH, and the endless connectivity. Next in the Linux series, though, we stay local and open up the filesystem properly.