$ cd ../ (all courses)

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

  1. 01
    Where am I?
    Print your current working directory.
    intro
  2. 02
    List the files
    List everything in your home directory.
    intro
  3. 03
    Find the hidden file
    Reveal the file whose name starts with a dot.
    intro
  4. 04
    Read a file
    Print the contents of welcome.txt.
    intro
  5. 05
    Make a directory
    Create a directory called `workspace` in your home.
    intro
  6. 06
    Create an empty file
    Create `journal.md` in your home.
    intro
  7. 07
    Write to a file
    Write the line `hello world` into `greet.txt`.
    easy
  8. 08
    Append, don't overwrite
    Add a line to greet.txt without erasing the previous one.
    easy
  9. 09
    Change directory
    cd into `projects` and list its contents.
    easy
  10. 10
    Nested directories at once
    Create the path `lab/exp1/data` in one command.
    easy
  11. 11
    Copy a file
    Copy `notes.md` to `notes.bak`.
    easy
  12. 12
    Rename / move
    Rename `notes.bak` to `notes_old.md`.
    easy
  13. 13
    Delete a file
    Remove `notes.md`.
    easy
  14. 14
    Recursively delete a folder
    Delete the `projects` directory and everything inside it.
    medium
  15. 15
    First and last lines
    Print only the LAST 2 lines of /var/log/syslog.log.
    medium
  16. 16
    Count the lines
    How many lines are in /etc/passwd?
    medium
  17. 17
    Search with grep
    Find every line in syslog containing the word `Failed`.
    medium
  18. 18
    Count matches
    How many `Failed` lines are in the log? Print only the number.
    medium
  19. 19
    Find by name
    Find every `.txt` file under /home.
    medium
  20. 20
    Find directories only
    List only directories under /home.
    medium
  21. 21
    Pipe one command into another
    Cat the syslog and pipe to grep to find SSH lines.
    medium
  22. 22
    Sort and dedupe
    Sort /usr/share/dict.txt in REVERSE alphabetical order.
    medium
  23. 23
    Extract a column with cut
    Get the list of usernames from /etc/passwd.
    medium
  24. 24
    Translate to uppercase
    Print welcome.txt in ALL CAPS using tr.
    medium
  25. 25
    Stream-edit with sed
    Replace every `linux` (any case) with `LINUX` in welcome.txt and print the result.
    hard
  26. 26
    Pull a column with awk
    Print the 5th word of every line in syslog.log.
    hard
  27. 27
    Find unique IPs that failed login
    From the syslog, list each unique source IP that had a failed login.
    hard
  28. 28
    Search a whole tree
    Recursively find every file under /home that mentions `secret` (case-insensitive).
    hard
  29. 29
    Save a pipeline result to a file
    Save the sorted unique words from /usr/share/dict.txt to /home/user/sorted.txt.
    hard
  30. 30
    Build a security report
    Write a 2-line report of failed-login activity to /home/user/report.txt.
    hard
  31. 31
    Concatenate two files
    Print welcome.txt followed by notes.md in one command.
    easy
  32. 32
    Inspect the data directory
    Show the tree of /home/user/data.
    easy
  33. 33
    Word count, not just lines
    Print the WORD count (only) of /etc/os-release.
    easy
  34. 34
    First three lines
    Print only the first 3 lines of /home/user/data/fruits.txt.
    easy
  35. 35
    Sort numbers numerically
    Sort /home/user/data/scores.txt as numbers, smallest first.
    medium
  36. 36
    Count occurrences with uniq -c
    Count how often each color appears in /home/user/data/colors.txt.
    medium
  37. 37
    Top of a frequency table
    From fruits.txt, list each fruit ONCE in alphabetical order.
    medium
  38. 38
    Case-insensitive search
    Find every line in syslog.log mentioning ssh (any case).
    medium
  39. 39
    Invert the match
    Print every line of syslog.log that does NOT mention sshd.
    medium
  40. 40
    Show line numbers
    Show every `ERROR` line in /home/user/data/log_levels.txt with its line number.
    medium
  41. 41
    Find ignoring case
    Find every CSV file under /home (any case).
    medium
  42. 42
    First column of a CSV
    Extract the `name` column from /home/user/data/users.csv.
    medium
  43. 43
    Pick multiple columns
    From users.csv, get columns 2 and 3 (role and city).
    medium
  44. 44
    Strip vowels with tr -d
    Print welcome.txt with all lowercase vowels removed.
    medium
  45. 45
    Read stdin from a file
    Use `<` to feed scores.txt into wc -l.
    medium
  46. 46
    Split a stream with tee
    Save the sorted unique colors to /home/user/unique_colors.txt while ALSO printing them.
    medium
  47. 47
    Chain commands with &&
    Make `/home/user/build` then `cd` into it — only if mkdir succeeds.
    medium
  48. 48
    Pipe find output into a file
    Save the list of every `.txt` under /home into /home/user/txt_files.txt.
    medium
  49. 49
    Project a CSV column
    Print only the city column (3rd) from users.csv.
    hard
  50. 50
    Substitute and save
    Write a copy of welcome.txt with every `codeshell` replaced by `CODESHELL` to /home/user/welcome_upper.txt.
    hard
  51. 51
    Frequency table from scratch
    From log_levels.txt, list each level with its count, sorted from most to least frequent.
    hard
  52. 52
    Filter and project
    From users.csv, list the names of users whose role is `admin`.
    hard
  53. 53
    Most popular city
    Print each city in users.csv with its count, most popular first.
    hard
  54. 54
    Failed-login user breakdown
    From syslog.log, list each invalid username that failed login with its count, descending.
    hard
  55. 55
    Final: build a daily summary
    Write /home/user/summary.txt with three exact lines reporting log totals.
    hard
  56. 56
    Generate a number list with seq
    Use `seq` to write the numbers 1..10 (one per line) into /tmp/nums.txt.
    easy
  57. 57
    Count bytes via stdin redirect
    Use `wc -c` reading from stdin (with `<`) on welcome.txt. Output must be just the number.
    easy
  58. 58
    Reverse-alphabetical colors
    Sort /home/user/data/colors.txt in REVERSE alphabetical order to stdout.
    easy
  59. 59
    Unique colors in one step
    Use sort with the right flag to get distinct colors into /tmp/unique_colors.txt.
    easy
  60. 60
    Extract a single middle line
    Print ONLY line 4 of /home/user/data/scores.txt by combining head and tail.
    medium
  61. 61
    Find the largest score
    Sort scores.txt as numbers in reverse and print only the largest one.
    medium
  62. 62
    SHOUTING todo list
    Translate todo.txt to ALL CAPS and save it as /tmp/TODO.txt.
    medium
  63. 63
    Convert CSV to semicolon-separated
    Replace every comma in users.csv with a semicolon and save as /tmp/users.ssv.
    medium
  64. 64
    Distinct login shells
    From /etc/passwd, list each unique login shell on its own line, sorted, into /tmp/shells.txt.
    medium
  65. 65
    How many bash users?
    Use grep -c on /etc/passwd to count accounts whose shell is /bin/bash.
    medium
  66. 66
    Catalog every markdown file
    Find every *.md file under /home/user and write the paths into /tmp/md_files.txt.
    medium
  67. 67
    Count INFO logs via stdin
    Pipe log_levels.txt into grep + wc -l to count how many lines say INFO.
    medium
  68. 68
    What's the most popular fruit?
    Find the single most frequent fruit in fruits.txt — print just its name.
    medium
  69. 69
    How many [ERR] entries?
    Count lines in /var/log/syslog.log that contain the literal text [ERR].
    medium
  70. 70
    List the distinct cities
    From users.csv, write the unique city names (no header) into /tmp/cities.txt.
    medium
  71. 71
    Rebrand blue → azure
    Stream-edit colors.txt replacing every 'blue' with 'azure' into /tmp/new_colors.txt.
    medium
  72. 72
    Which IPs tried to break in?
    From syslog.log, write each unique IP that appears on a 'Failed password' line into /tmp/bad_ips.txt.
    hard
  73. 73
    Which cities have admins?
    From users.csv, list the distinct cities of users whose role is 'admin', into /tmp/admin_cities.txt.
    hard
  74. 74
    Tee both ways
    Sort scores numerically, save the sorted list to /tmp/sorted.txt with tee, and pipe onward to print only the smallest.
    hard
  75. 75
    Three-line passwd summary
    Build /tmp/passwd_summary.txt with exactly: total=3, bash=2, nologin=1.
    hard
  76. 76
    Log-level frequency table
    Produce /tmp/levels.txt with each log level and its count, sorted by count descending.
    hard
  77. 77
    Boss-level ops report
    Build /home/user/ops_report.txt assembling stats from passwd, users.csv, and syslog.log.
    hard