ABC of Electronics cosycom.com
RASPBERRY PI 06 · Linux Basics

Essential Linux Commands for Raspberry Pi

A short, practical list of the commands you'll type constantly — enough to navigate, inspect, and manage files confidently.

You don't need to memorize a large command set to be productive — a small, well-understood core covers the large majority of everyday terminal work:

Commands used throughout this course
CommandWhat it does
pwdPrint the current directory you're in
lsList files in the current directory (ls -la shows hidden files and details)
cd folderChange into a directory (cd .. goes up one level)
mkdir nameCreate a new directory
nano file.pyOpen a simple, beginner-friendly text editor for that file
python3 file.pyRun a Python script
sudo commandRun a command with administrator privileges (needed for system changes)
Ctrl+CStop whatever's currently running in the terminal

Two habits worth building early: tab completion — start typing a file or folder name and press Tab to auto-complete it, which both saves typing and avoids typos — and reading error messages fully rather than skimming past them; Linux command-line errors are usually specific about exactly what went wrong and where.

sudo deserves a note of caution: it temporarily grants a command full administrative power over the system, which is necessary for some setup tasks (like the ones in the next lesson) but also means a mistyped destructive command run with sudo has no safety net. Use it deliberately, not as a reflex whenever a command fails.

$ pwd /home/pi $ ls project.py README.mdabcofelectronics
Two of the most-typed commands in any Linux session: pwd to confirm where you are, ls to see what's there.
TRY THIS
Use Tab to auto-complete file and folder names as you type — it's faster and eliminates most typos in long file paths.