Linux command line basics
Sixteen short lessons, each with a practice terminal right in the page. Read a little, type the commands, and the lesson checks your work as you go. Nothing to install, and nothing you type leaves your browser.
Key facts
- 16 lessons of 4 to 10 minutes, about 1 h 42 min in all.
Your progress
0 of 16 lessons
The lessons
Finding your way
Working with files
- Lesson 4: Make folders and files: mkdir and touch5 min
mkdirmkdir -ptouch - Lesson 5: Copy, move and rename: cp and mv7 min
cpcp -rmv - Lesson 6: Delete files and folders safely: rm and rmdir6 min
rmrmdirrm -r - Lesson 7: Read files: cat, head and tail6 min
catheadtail - Lesson 8: Write to files: echo with > and >>6 min
>>>echo - Lesson 9: Wildcards: work with many files at once6 min
*?[ ]
Permissions
Pipes and searching
Practice terminal
No task, no checks: a home directory full of sample files to try anything on. Type ls to look around, or help for every command.
Enter runs · Tab completes names · ↑ ↓ step through history · Ctrl+L clears · type help for every command
Command reference
Each command’s options, with examples you can run in a terminal on the page.
lslist the files and folders in a directorycdchange the current directorycatprint the contents of filesechoprint a line of textmkdirmake directoriesrmremove files or directoriescpcopy files and directoriesmvmove or rename files and directoriestouchcreate empty files, or update a file’s timegrepprint lines that match a patternfindsearch for files in a directory treechmodchange file permissionsheadprint the first lines of filestailprint the last lines of fileswccount lines, words and bytessortsort lines of textuniqremove or count repeated lines
Frequently Asked Questions
Do I need Linux installed to do these lessons?
No. Each lesson has a practice terminal that runs in your browser on any computer or phone, with its own set of files. It behaves like bash on a Linux system for the commands the lessons teach, and nothing you type is sent anywhere.
Is this a real Linux terminal?
It is a simulation written for these lessons: a small shell with an in-memory filesystem and the everyday commands (ls, cd, cat, cp, mv, rm, mkdir, grep, find, chmod, sort, wc and more), with the same options, output and error messages as GNU/Linux. It can’t install software or reach the internet, and the lessons never need it to.
How long does the course take?
The 16 lessons take 4 to 10 minutes each, about an hour and three quarters in all. You can stop at any point: finished lessons are remembered in this browser.
Where is my progress saved?
In this browser only, like everything else on the site. It is included when you back up your data at /backup, and syncs to your other devices if you have set up sync. The commands you type are never saved.
What if I break something in the practice terminal?
Press Reset lesson and the lesson’s files come back exactly as they started. That makes it a safe place to try rm -r and wildcards before using them on a real computer.