Linux command line basics
Sixteen short lessons, each with a practice terminal right in the page.
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.
Your progress
0 of 16 lessons
The lessons
Finding your way
Working with files
- Lesson 4: Make folders and files:
mkdirandtouch5 minmkdirmkdir -ptouch - Lesson 5: Copy, move and rename:
cpandmv7 mincpcp -rmv - Lesson 6: Delete files and folders safely:
rmandrmdir6 minrmrmdirrm -r - Lesson 7: Read files:
cat,headandtail6 mincatheadtail - Lesson 8: Write to files:
echowith>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.
Free practice. Your home directory has sample files and folders to try commands on.
Starting…
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
Key facts
- 16 lessons of 4 to 10 minutes, about 1 h 42 min in all.
- Every lesson has a practice terminal in the page that checks your work as you type, with hints and an answer.
- From pwd, ls and cd to permissions, pipes, grep and find, ending with a mini challenge.
Common 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 in the terminal’s toolbar 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.