Linux Terminal
Master the command line — real shell simulation, no installs.
About Linux Terminal
The Linux command line is the universal language of servers, devops, and power users. This course runs in a fully simulated POSIX-style shell built into your browser. You get a virtual filesystem, real pipes, redirects, and 40+ classic commands like ls, grep, find, sed, awk, and more. Type commands directly into the terminal pane on the right. Each task checks the resulting filesystem state and/or your command output, so the only way to pass is to actually do the work.
Quick-reference cheat sheet
# Linux command-line cheat-sheet
# Navigation
pwd # print working directory
ls # list files (try -l, -a, -la)
cd path # change directory (cd ~ , cd .. , cd /)
tree # show directory tree
# Files
touch file # create empty file
mkdir dir # make directory (mkdir -p a/b/c for nested)
rm file # remove file (rm -r dir for directory)
rmdir dir # remove EMPTY dir
cp src dst # copy (cp -r for dirs)
mv src dst # move / rename
cat file # print file
head -n 5 file # first 5 lines
tail -n 5 file # last 5 lines
wc -l file # count lines
# Search
grep "pat" file # search lines (-i ignore case, -v invert, -n line nums, -r recursive)
find . -name "*.txt" # find by name (-type f / -type d)
which ls # locate a binary
# Text munging
sort file # sort lines (-n numeric, -r reverse, -u unique)
uniq # collapse adjacent dupes (use after sort)
cut -d: -f1 file # take 1st field, ":" delimited
tr 'a-z' 'A-Z' # translate / delete chars
sed 's/foo/bar/g' # stream-edit
awk '{print $2}' # field extraction (limited)
# Plumbing
cmd1 | cmd2 # pipe stdout to stdin
cmd > file # write stdout to file (overwrite)
cmd >> file # append
cmd < file # read stdin from file
cmd1 && cmd2 # run cmd2 only if cmd1 succeeds
cmd1 ; cmd2 # run sequentially regardless
# System
whoami # current user
id # uid / gid
uname -a # kernel info
hostname # machine name
date # current date
env # environment vars
history # previous commands
df / du # disk usage
Tasks
- 01introWhere am I?Print your current working directory.
- 02introList the filesList everything in your home directory.
- 03introFind the hidden fileReveal the file whose name starts with a dot.
- 04introRead a filePrint the contents of welcome.txt.
- 05introMake a directoryCreate a directory called `workspace` in your home.
- 06introCreate an empty fileCreate `journal.md` in your home.
- 07easyWrite to a fileWrite the line `hello world` into `greet.txt`.
- 08easyAppend, don't overwriteAdd a line to greet.txt without erasing the previous one.
- 09easyChange directorycd into `projects` and list its contents.
- 10easyNested directories at onceCreate the path `lab/exp1/data` in one command.
- 11easyCopy a fileCopy `notes.md` to `notes.bak`.
- 12easyRename / moveRename `notes.bak` to `notes_old.md`.
- 13easyDelete a fileRemove `notes.md`.
- 14mediumRecursively delete a folderDelete the `projects` directory and everything inside it.
- 15mediumFirst and last linesPrint only the LAST 2 lines of /var/log/syslog.log.
- 16mediumCount the linesHow many lines are in /etc/passwd?
- 17mediumSearch with grepFind every line in syslog containing the word `Failed`.
- 18mediumCount matchesHow many `Failed` lines are in the log? Print only the number.
- 19mediumFind by nameFind every `.txt` file under /home.
- 20mediumFind directories onlyList only directories under /home.
- 21mediumPipe one command into anotherCat the syslog and pipe to grep to find SSH lines.
- 22mediumSort and dedupeSort /usr/share/dict.txt in REVERSE alphabetical order.
- 23mediumExtract a column with cutGet the list of usernames from /etc/passwd.
- 24mediumTranslate to uppercasePrint welcome.txt in ALL CAPS using tr.
- 25hardStream-edit with sedReplace every `linux` (any case) with `LINUX` in welcome.txt and print the result.
- 26hardPull a column with awkPrint the 5th word of every line in syslog.log.
- 27hardFind unique IPs that failed loginFrom the syslog, list each unique source IP that had a failed login.
- 28hardSearch a whole treeRecursively find every file under /home that mentions `secret` (case-insensitive).
- 29hardSave a pipeline result to a fileSave the sorted unique words from /usr/share/dict.txt to /home/user/sorted.txt.
- 30hardBuild a security reportWrite a 2-line report of failed-login activity to /home/user/report.txt.
- 31easyConcatenate two filesPrint welcome.txt followed by notes.md in one command.
- 32easyInspect the data directoryShow the tree of /home/user/data.
- 33easyWord count, not just linesPrint the WORD count (only) of /etc/os-release.
- 34easyFirst three linesPrint only the first 3 lines of /home/user/data/fruits.txt.
- 35mediumSort numbers numericallySort /home/user/data/scores.txt as numbers, smallest first.
- 36mediumCount occurrences with uniq -cCount how often each color appears in /home/user/data/colors.txt.
- 37mediumTop of a frequency tableFrom fruits.txt, list each fruit ONCE in alphabetical order.
- 38mediumCase-insensitive searchFind every line in syslog.log mentioning ssh (any case).
- 39mediumInvert the matchPrint every line of syslog.log that does NOT mention sshd.
- 40mediumShow line numbersShow every `ERROR` line in /home/user/data/log_levels.txt with its line number.
- 41mediumFind ignoring caseFind every CSV file under /home (any case).
- 42mediumFirst column of a CSVExtract the `name` column from /home/user/data/users.csv.
- 43mediumPick multiple columnsFrom users.csv, get columns 2 and 3 (role and city).
- 44mediumStrip vowels with tr -dPrint welcome.txt with all lowercase vowels removed.
- 45mediumRead stdin from a fileUse `<` to feed scores.txt into wc -l.
- 46mediumSplit a stream with teeSave the sorted unique colors to /home/user/unique_colors.txt while ALSO printing them.
- 47mediumChain commands with &&Make `/home/user/build` then `cd` into it — only if mkdir succeeds.
- 48mediumPipe find output into a fileSave the list of every `.txt` under /home into /home/user/txt_files.txt.
- 49hardProject a CSV columnPrint only the city column (3rd) from users.csv.
- 50hardSubstitute and saveWrite a copy of welcome.txt with every `codeshell` replaced by `CODESHELL` to /home/user/welcome_upper.txt.
- 51hardFrequency table from scratchFrom log_levels.txt, list each level with its count, sorted from most to least frequent.
- 52hardFilter and projectFrom users.csv, list the names of users whose role is `admin`.
- 53hardMost popular cityPrint each city in users.csv with its count, most popular first.
- 54hardFailed-login user breakdownFrom syslog.log, list each invalid username that failed login with its count, descending.
- 55hardFinal: build a daily summaryWrite /home/user/summary.txt with three exact lines reporting log totals.
- 56easyGenerate a number list with seqUse `seq` to write the numbers 1..10 (one per line) into /tmp/nums.txt.
- 57easyCount bytes via stdin redirectUse `wc -c` reading from stdin (with `<`) on welcome.txt. Output must be just the number.
- 58easyReverse-alphabetical colorsSort /home/user/data/colors.txt in REVERSE alphabetical order to stdout.
- 59easyUnique colors in one stepUse sort with the right flag to get distinct colors into /tmp/unique_colors.txt.
- 60mediumExtract a single middle linePrint ONLY line 4 of /home/user/data/scores.txt by combining head and tail.
- 61mediumFind the largest scoreSort scores.txt as numbers in reverse and print only the largest one.
- 62mediumSHOUTING todo listTranslate todo.txt to ALL CAPS and save it as /tmp/TODO.txt.
- 63mediumConvert CSV to semicolon-separatedReplace every comma in users.csv with a semicolon and save as /tmp/users.ssv.
- 64mediumDistinct login shellsFrom /etc/passwd, list each unique login shell on its own line, sorted, into /tmp/shells.txt.
- 65mediumHow many bash users?Use grep -c on /etc/passwd to count accounts whose shell is /bin/bash.
- 66mediumCatalog every markdown fileFind every *.md file under /home/user and write the paths into /tmp/md_files.txt.
- 67mediumCount INFO logs via stdinPipe log_levels.txt into grep + wc -l to count how many lines say INFO.
- 68mediumWhat's the most popular fruit?Find the single most frequent fruit in fruits.txt — print just its name.
- 69mediumHow many [ERR] entries?Count lines in /var/log/syslog.log that contain the literal text [ERR].
- 70mediumList the distinct citiesFrom users.csv, write the unique city names (no header) into /tmp/cities.txt.
- 71mediumRebrand blue → azureStream-edit colors.txt replacing every 'blue' with 'azure' into /tmp/new_colors.txt.
- 72hardWhich IPs tried to break in?From syslog.log, write each unique IP that appears on a 'Failed password' line into /tmp/bad_ips.txt.
- 73hardWhich cities have admins?From users.csv, list the distinct cities of users whose role is 'admin', into /tmp/admin_cities.txt.
- 74hardTee both waysSort scores numerically, save the sorted list to /tmp/sorted.txt with tee, and pipe onward to print only the smallest.
- 75hardThree-line passwd summaryBuild /tmp/passwd_summary.txt with exactly: total=3, bash=2, nologin=1.
- 76hardLog-level frequency tableProduce /tmp/levels.txt with each log level and its count, sorted by count descending.
- 77hardBoss-level ops reportBuild /home/user/ops_report.txt assembling stats from passwd, users.csv, and syslog.log.
