Skip to main content
Text ready — video coming soon

Files, editors and terminals: find where the work runs

Hello again! Binary and languages showed how instructions reach the processor. Now let's find where a program actually lives, and the tools you use to change it and run it.

In this lesson, you'll learn:

  • what files, folders and paths are;
  • what an editor does;
  • what a terminal and a shell do;
  • how to stay safe with commands.

Why it matters: coding tools, including AI coding tools, work through files and terminals. Once you know what each one does, they stop looking mysterious.

You can follow everything here without opening any tool.

Where a program is stored: files, folders and paths​

A file is a named piece of stored information: some text, a picture, a program. A folder, also called a directory, holds files and other folders.

Say we save our committee program in a file called committee.py, inside a folder called committee-example. The .py ending tells people and tools that the file contains Python.

A path tells software where to find a file, like an address. For example: committee-example/committee.py. If a tool looks in the wrong folder, it won't find the file.

A saved file is just stored text. Nothing happens until something runs it.

Editors: where you change the text​

An editor is an app for reading and changing text. Program text is called code. A code editor helps you read code, for example by showing different parts in different colours. VS Code is a popular one.

You'll also hear IDE, short for integrated development environment. It is a code editor with extra tools built in, for example to run a program or to help find a mistake. Many editors can add these tools too, so the line between the two is blurry. What matters is the job you use it for.

Two things to remember:

  • Changing the text is not the same as saving it, and saving it is not the same as running it.
  • Nice colours don't mean the code is right.

Terminals and shells: where you type commands​

Some tools are used by typing commands instead of clicking. You type them in a terminal: a window where you type a command and read the reply.

The program that reads your command and acts on it is the shell. PowerShell, Bash and Zsh are common shells. Software that you use by typing commands has a CLI, a command-line interface.

So the terminal is the window, and the shell is the program inside it that understands your commands. Different shells understand different commands. Which shells you have depends on your computer and its operating system, such as Windows, macOS or Linux.

What one harmless command does​

Here is a command for PowerShell, the shell that comes with Windows:

Write-Output "Ready to check"

Write-Output is the command's name. The words in quotes are what you give it. When you run it, PowerShell shows:

Ready to check

That's all it does: it shows a message. It doesn't create a file, change anything or run the committee program.

Bash and most other shells don't know this command, so it fails there. That's why you should always know which shell you're typing into.

How to stay safe with commands​

A command can also delete files or change settings, and the terminal window looks exactly the same either way. So before you run a command you don't fully understand, ask:

  • Which program will read it?
  • What will it read, and what will it change?
  • Which folder will it work in?

Be extra careful with commands copied from a website or a message.

Safety floor

Never run a command you can't explain in a folder that holds real work or private information. Practise in a separate folder with sample data. Never give a command administrator access, or paste a password, just to make it work. A convincing explanation doesn't make a command safe: check what it does.

Check what you can now explain​

Without looking back:

  1. What changes when you edit committee.py and save it? What doesn't happen yet?
  2. What is the difference between the terminal and the shell?
  3. Why might a command fail in a different shell, or in a different folder?

Next, we'll open committee.py and read the Python inside it, line by line.