Portmint Lighthouse

Running a Program

Here is the plain idea: the terminal isn't only for arranging files — it's also how you run programs. You type the program's name, press Enter, and it does its job. In fact, you've been doing this all along: every command you've typed — ls, cd, cp — is a tiny program. Running a program is just the same move, applied to bigger tools.

This is the part that makes the terminal genuinely powerful. With a mouse you run a program by finding its icon and double-clicking. With the terminal you summon it by name. Once you see that every command is a program, the whole thing clicks together.

Calling a worker by name

Imagine a workshop full of specialists, each ready at their bench. There's a counter who counts things, a sorter who sorts, a printer who prints. You don't go fetch them — you call their name, hand over your request, and they get to work.

Running a program is calling a worker by name. ls is the worker who lists; cp is the worker who copies. When you type a program's name, you're calling that specialist up to do their one job, right where you're standing.

A command is a program plus details

Every command you type has the same simple shape: the program's name first, then any details it needs. Those details come in two flavours, both of which you've already met.

cp -i notes.txt backup.txt
  • cp is the program — the worker you're calling.
  • -i is a flag — a little switch that tweaks how the worker behaves (here, "ask before overwriting").
  • notes.txt and backup.txt are arguments — the actual things you're handing the worker to act on.

That's the entire grammar of the terminal: a name, optional switches, and the stuff to work on. Every command, simple or fancy, follows that one pattern. Once you see it, no command looks like gibberish anymore — it's just "who, how, what."

Trying a friendly program

Let's run one you haven't seen, just to feel it. The echo program does one cheerful thing: it repeats back whatever you give it.

echo Hello there

Press Enter and the terminal prints Hello there. That's it — you called a program by name, handed it some words, and it did its job. Silly? A little. But it's a real program, run by you, and it proves the pattern works.

Here's another genuinely useful one. The cat program prints out the contents of a file:

cat notes.txt

If notes.txt has writing in it, cat shows it right there in the terminal — a quick peek without opening a separate app. (The name comes from "concatenate," but think of it as "show me what's inside.")

When a program keeps running

Most everyday commands finish in a blink and hand you back the prompt. But some programs are meant to keep going — a clock that keeps ticking, a server that keeps listening. When you start one of those, the prompt won't come back, because the program is still working.

That's not a freeze; it's a program doing its job. And there's one universal "okay, stop now" you should know: hold Ctrl and press C (often written Ctrl+C). That gently tells the running program "that's enough, hand the prompt back." It's the terminal's stop button — calm, safe, and good to have in your pocket the first time something keeps running and you wonder how to get out.

Your turn

In your terminal, type echo I am running a program and press Enter. Watch your words come back — you ran a program.

Now, if you have a .txt file with anything written in it, try cat on it to peek inside. (If your files are empty, that's fine — cat will simply show nothing.) You've now used the terminal not just to tidy files, but to do things. That's the full toolkit.

Next up: putting it all together — and a project you'll build and share to prove it. 🐙

Stuck or curious?

Ask Pip about this lesson — tap the porthole bottom-right.