How to Use the Command Line as a Complete Beginner
You followed a Python tutorial, it said "open your terminal and type this", and you stared at a black window with a blinking cursor and no idea what was allowed. That moment stops more new coders at our club than any syntax error ever does.

You followed a Python tutorial, it said "open your terminal and type this", and you stared at a black window with a blinking cursor and no idea what was allowed. That moment stops more new coders at our club than any syntax error ever does.
The command line is just a text way to do things you already do with a mouse: open folders, list files, run programs. This guide teaches the eight commands you actually need in your first month, how to read what the terminal tells you, and how to avoid the two mistakes that scare beginners off for good.
What the command line actually is
When you double click a folder, your computer opens it and shows you the files inside. The command line does the same thing, except you type the instruction instead of clicking. The program that shows the window is called a terminal. The program inside it that reads your typing is called a shell.
On Windows you will usually use PowerShell or Command Prompt. On macOS it is the Terminal app running a shell called zsh. On Linux it is usually bash. The commands differ slightly between Windows and the other two, and I will point out where.
The line that ends in a symbol like a dollar sign or an arrow is the prompt. It also shows where you are right now, called the current directory. Everything you type runs from that location, which is the single most useful fact in this whole article.
The eight command line basics for your first month
| Task | macOS and Linux | Windows PowerShell |
|---|---|---|
| Show where you are | pwd | pwd |
| List files here | ls | ls or dir |
| Go into a folder | cd projects | cd projects |
| Go up one level | cd .. | cd .. |
| Make a folder | mkdir club | mkdir club |
| Make an empty file | touch notes.txt | ni notes.txt |
| Run a Python file | python3 hello.py | python hello.py |
| Clear the screen | clear | cls or clear |
That is it. Our club organiser counted once: in the first six weeks of the beginner track, students used those eight commands for roughly 95 percent of everything they typed.
A ten minute practice session
Do this once, slowly, and the terminal stops feeling like a locked door. Type each line and press Enter.
- Type pwd. You will see something like /Users/sam or C:\Users\sam. That is your home folder.
- Type mkdir codeclub. Nothing prints. In the command line, silence usually means success.
- Type cd codeclub, then pwd again. Notice the path now ends in codeclub.
- Create a file called hello.py in this folder using your code editor, with one line inside: print("hi from the terminal").
- Type ls. You should see hello.py listed.
- Type python hello.py (or python3 on a Mac). The message prints.
- Type cd .. to go back up, then ls to see codeclub as a folder in your home directory.
If step 6 fails with "No such file or directory", you are almost certainly in the wrong folder. Run pwd and ls to check. That one habit fixes most terminal confusion we see on club nights.
Reading what the terminal tells you
The terminal does not do friendly pop ups. It prints text, and that text is information, not a judgement. Three messages cover most beginner trouble:
- "command not found" or "is not recognized". You either made a typo or the program is not installed. Check spelling first. Then check that Python is installed by asking Python for its version number, which the install guide for your system will show you how to do.
- "No such file or directory". The file is not in your current folder. Use ls to see what is actually there.
- "Permission denied". You are trying to change something the system protects. As a beginner, you almost never need to fix this. Work inside your own home folder instead.
When Python itself errors, you get a traceback, which is a different kind of message. Our guide on how to read a Python error message when you are new walks through one line by line.
Two habits that save hours
Use Tab to finish names
Type cd cod and press Tab. The shell fills in codeclub for you. This avoids typos and also proves the folder exists. If Tab does nothing, the name you started does not match anything in the current folder.
Use the up arrow to repeat commands
Pressing the up arrow brings back the last command. Press it again for the one before. When you are running the same script twenty times while fixing a bug, this saves real time.
Why you do not need to memorise a long command list
Plenty of beginner guides hand you a cheat sheet with 50 or 60 commands and tell you to learn them all before writing code. I think that is backwards, and it puts people off.
Memorising commands you have no reason to use does not stick. You forget grep, chmod and find within a week because nothing in your day needs them. Learn the eight above, write real programs, and pick up new commands only when a project asks for one. When you set up version control for a club project, you will learn a handful of git commands in context, and they will stay with you because you used them that evening. Our walkthrough on running a Git group project at your coding club is a good place to meet them.
The same goes for scary looking flags like -rf. You do not need them in month one. If a tutorial asks you to paste a command you do not understand, especially one that starts with rm or sudo, pause and ask someone first.
Where to go next
Once these basics feel normal, a few small steps build on them nicely. Open the terminal built into your code editor so your files and commands sit side by side. Try running a script with an argument, such as python greet.py Sam, and read the name inside your program. Then practise moving between two project folders without using the mouse at all for a whole session.
If you are still deciding what to study after this, what to learn first when you know nothing about coding lays out a sensible order.
Frequently asked questions
Is the command line the same as coding?
Not exactly. The command line is a tool for telling the computer what to do, including running the code you write. You can write code without using it much, but most tutorials and real projects expect at least the basics, so learning a few commands early removes a common roadblock.
Can I break my computer using the command line?
It is possible, but very unlikely with beginner commands like ls, cd, mkdir and python. The risky ones are delete commands and anything run with administrator rights. Stay inside your own folders and do not paste commands you do not understand.
Should beginners use PowerShell or Command Prompt on Windows?
PowerShell is the better choice for most beginners today. It accepts common commands like ls and pwd that tutorials use, and it comes installed on every recent version of Windows. Command Prompt still works, but you will find fewer modern guides written for it.
More in First Steps
First Steps
How to Escape Tutorial Hell and Build Something Real
One of our club members turned up last autumn having watched roughly sixty hours of Python video across four months.
First Steps
How to Debug With Print Statements as a Beginner
A student I coach spent most of a Tuesday evening convinced that Python was adding numbers wrong.
First Steps
How to Ask a Coding Question That Gets a Real Answer
A student in my Thursday group spent eleven days stuck on the same program.