Command Line Basics: Master the Terminal
Learn the essential commands that power every computer
Learn the essential commands that power every computer
Before fancy graphical interfaces, computers were controlled entirely by typing commands. Today, the command line remains the most powerful way to interact with computers.
In Linux, everything is organized in a tree structure. Folders (directories) contain files and other folders.
Every file has a unique address called a path, like /home/username/Documents/report.txt
You tell the computer what to do: ls (list), cd (change), mkdir (make).
The first two commands every terminal user needs: find out where you are, and see what's around you.
Use the terminal to explore. Type these commands:
-la to ls for the full view: ls -la shows all files (including hidden) in long format!
Move around the directory tree with the cd (change directory) command. It's like double-clicking folders, but faster!
/home/username/Documents
Start from where you are: cd Documents goes to Documents inside current folder.
Start from root: cd /home/user/Documents works from anywhere.
Two dots means "parent directory". cd ../ goes up one level.
Try moving through directories:
Now let's create! mkdir makes new folders, and touch creates empty files.
Create your own folder structure:
Want to see what's inside a file? The cat command displays file contents right in your terminal.
Cat is perfect for small files. For large files, use less or head.
Cat can join files: cat a.txt b.txt > combined.txt
Try reading files in the terminal:
Here are all the essential commands you've learned. Click any card to mark it as learned!
help in the terminal to see ALL available commands. There's so much more to explore!
You've learned the essential commands that every developer, sysadmin, and power user needs. The command line is now your superpower!
"Print Working Directory" tells you exactly where you are in the filesystem.
See what files and folders exist in any directory.
Navigate anywhere with paths - use .. to go up, / for absolute paths.
"Make Directory" creates new folders wherever you need them.
Quickly create empty files or update timestamps.
Display the contents of any text file instantly.
Put your new knowledge into practice!