Skip to main content
DevOpsLabTH.dev

Linux

The terminal habits that separate working engineers from people who tab into the AWS Console. Navigate, observe, and compose by the end.

beginner55 labs
By the end you'll be able to
  • Navigate any unfamiliar Linux box without panic
  • Read what a process is doing without restarting it
  • Pipe small tools together to answer real questions
  • Manage permissions and find files without reaching for sudo

Labs

  1. 01
    What is Linux
    Before you type a single command, understand what Linux is and why DevOps engineers use it every day.
    5 min
    Start
  2. 02
    What is a terminal
    Understand what the black rectangle full of text actually is, and why engineers prefer it to clicking icons.
    5 min
    Start
  3. 03
    Read the prompt
    Decode `learner@dlth:~$`. Each piece tells you something useful before you type a single command.
    5 min
    Start
  4. 04
    The filesystem is a tree
    Linux organises every file in a single tree starting at `/`. See it once and the layout makes sense forever.
    5 min
    Start
  5. 05
    What a command really is
    A command is just a program the shell finds on a list of folders called PATH. Once you see that, the magic dissolves.
    5 min
    Start
  6. 06
    Where am I (pwd)
    Print the absolute path of the directory the shell is in. The first thing to ask before you do anything else.
    3 min
    Start
  7. 07
    List files (ls, ls -l, ls -a)
    Three flavours of ls. Bare for a quick look, `-l` for details, `-a` for hidden files.
    5 min
    Start
  8. 08
    Move around (cd)
    Walk between directories with cd, climb with cd .., go home with cd ~.
    5 min
    Start
  9. 09
    Hidden files (the dot convention)
    Filenames that start with a dot are hidden from default `ls`. Reveal them with `ls -a`. The convention covers `.bashrc`, `.ssh/`, `.git/`, `.env`.
    5 min
    Start
  10. 10
    What kind of file is this? (file)
    Use `file` to identify what something actually is by inspecting magic bytes. Saves you from `cat`-ing a binary and garbling your terminal.
    5 min
    Start
  11. 11
    Read files (cat, head, tail, less)
    Four ways to read a file. Pick the one that matches the file's size and your intent.
    6 min
    Start
  12. 12
    Read big files (less + search)
    `less` is a pager. Open a long file, scroll, search forward with `/`, jump matches with `n`, quit with `q`. Stops `cat` from flooding your terminal.
    5 min
    Start
  13. 13
    Follow a log (tail -f)
    Watch a log file as new lines arrive. The `-f` flag keeps the file open and streams updates in real time.
    5 min
    Start
  14. 14
    Make folders (mkdir)
    Create directories. Plain mkdir for one. mkdir -p for nested paths in a single shot.
    4 min
    Start
  15. 15
    Make files (touch)
    Create empty files. The simplest building block for everything else you'll do with text on Linux.
    3 min
    Start
  16. 16
    Write to a file with > and >>
    Two operators that write text to files without opening an editor. The fastest way to script file content.
    4 min
    Start
  17. 17
    Find files (find)
    Locate files anywhere on disk by name, type, or modification time. The 'where did I put that' command.
    5 min
    Start
  18. 18
    Find by time and size
    Use `find -mtime` to filter by age and `-size` to filter by file size. The two tests that drive most disk-cleanup scripts.
    7 min
    Start
  19. 19
    Search inside files (grep)
    find locates files; grep looks INSIDE them. Plain grep for one file, grep -r for a tree.
    6 min
    Start
  20. 20
    grep with context (-A -B -C, -i)
    Show lines around a match with -A and -B. Match case-insensitively with -i. The flags that turn grep from finder into reader.
    5 min
    Start
  21. 21
    Edit with nano
    Nano is the friendly terminal editor. Type, Ctrl+O to save, Ctrl+X to exit. That's the whole story.
    5 min
    Start
  22. 22
    Vim survival mode
    Just enough vim to open a file, edit it, save, and quit. Not a vim course, a not-getting-stuck course.
    6 min
    Start
  23. 23
    Copy and move (cp, mv)
    Duplicate a file with cp. Rename or relocate one with mv. The first leaves the source; the second doesn't.
    5 min
    Start
  24. 24
    Delete safely (rm)
    Remove files with rm. Understand what -r and -f mean. The single command engineers most regret typing.
    6 min
    Start
  25. 25
    Archive and compress (tar + gzip)
    Bundle a directory into a single `.tar.gz` file, then extract it back. The standard way to ship code, configs, and backups on Linux.
    6 min
    Start
  26. 26
    Read file permissions (ls -l decoded)
    The 10-character string at the start of `ls -l` tells you who can do what. Learn to read it before you change it.
    5 min
    Start
  27. 27
    chmod numeric (644, 755, 600)
    Three octal digits. Owner, group, others. The fastest way to set permissions exactly the way you want.
    5 min
    Start
  28. 28
    chmod symbolic (u+x, g-w)
    Symbolic mode uses letters: u (user), g (group), o (others), + (add), - (remove). When you only want to flip one bit, this is faster than numeric.
    5 min
    Start
  29. 29
    Who owns this file? (chown + chgrp)
    Read user and group ownership from `ls -l`, try `chown` without root to see why it fails, and use `chgrp` to switch a file's group.
    6 min
    Start
  30. 30
    Make a script executable and run it
    Write a tiny shell script, set the execute bit with chmod +x, and run it. The full lifecycle of a Unix program from your fingertips.
    6 min
    Start
  31. 31
    List running processes (ps aux)
    Every process on the box, with its user, CPU, memory, and command line. The first thing to run when something feels wrong.
    5 min
    Start
  32. 32
    Background jobs (&, jobs, fg)
    Send a long-running command to the background with &, list it with jobs, bring it back with fg.
    5 min
    Start
  33. 33
    Survive logout (nohup + disown)
    Start a background job that survives the shell closing. Use `nohup` to ignore SIGHUP, and `disown` to drop a running job from the shell's job table.
    7 min
    Start
  34. 34
    Stop a process (kill, kill -9)
    Send a signal with kill. Default is TERM (polite). Escalate to KILL with -9 when the process ignores you.
    5 min
    Start
  35. 35
    See the process tree (ps -ef --forest)
    Every process has a parent. The tree view shows you who started what.
    5 min
    Start
  36. 36
    stdin, stdout, stderr
    Every program has three streams. Once you can name them, redirection and pipes stop being magic.
    5 min
    Start
  37. 37
    Redirection (>, >>, 2>&1)
    Stream output to files. > overwrites, >> appends, 2>&1 captures errors.
    4 min
    Start
  38. 38
    Pipes (|)
    Send the output of one command as the input of the next. The vertical bar that turns Unix into Lego.
    4 min
    Start
  39. 39
    Pipe through grep
    The classic 'cat file | grep pattern' combo. The shape of every Unix one-liner you'll write for the rest of your career.
    4 min
    Start
  40. 40
    Combine pipes and redirects
    Pipe through wc, redirect the count to a file. Two operators stacked, one of the most common shell shapes.
    4 min
    Start
  41. 41
    Count, sort, and dedupe (wc, sort, uniq)
    Three commands that turn pipes into real analysis. Count lines. Sort them. Deduplicate. The 'top N requesters' one-liner is built from these.
    6 min
    Start
  42. 42
    Pull columns and translate (cut, tr)
    cut extracts specific columns or characters. tr translates one set of characters into another. Two surgical tools for cleaning data.
    5 min
    Start
  43. 43
    Stream edit (sed)
    Find-and-replace text without opening an editor. The most common shell one-liner pattern of all time.
    6 min
    Start
  44. 44
    Process columns with awk
    awk treats each line as a row of fields. Pull columns, do math, filter rows. The Unix one-liner secret weapon.
    6 min
    Start
  45. 45
    Split output (tee)
    Send the same output to a file AND to the next pipe stage. Useful for logging mid-pipeline and for sudo-write tricks.
    5 min
    Start
  46. 46
    Disk and memory (df, du, free)
    Three commands answer 'is this box healthy.' df for filesystems, du for what's eating disk, free for memory.
    5 min
    Start
  47. 47
    System info (uname, uptime, who)
    Three commands tell you what kernel you're on, how long the box has been up, and who else is logged in.
    4 min
    Start
  48. 48
    Environment ($PATH, env, .bashrc)
    Environment variables are how processes inherit context. $PATH tells the shell where to find commands. env shows them all.
    5 min
    Start
  49. 49
    Persist variables (export + .bashrc)
    A plain assignment lives in the current shell only. export hands a variable down to child processes. ~/.bashrc is what makes it survive a new shell.
    5 min
    Start
  50. 50
    Quoting (single, double, backtick)
    Single quotes are literal. Double quotes expand $VAR and $(cmd). Backticks run a command and substitute its output. Most bash bugs in the wild are wrong-quote bugs.
    6 min
    Start
  51. 51
    Globs (*, ?, [abc])
    Glob patterns are expanded by the shell before the command runs. The kernel never sees a glob. Quoting disables it.
    6 min
    Start
  52. 52
    Variable expansion patterns
    Bash has a small set of expansion forms that show up in every script. Defaults, suffix and prefix trimming, last exit code, and the current PID.
    7 min
    Start
  53. 53
    Diagnose a permission denied
    A script refuses to run with permission denied. Read the permission bits to find why, fix the one that is wrong, and make the script produce its output.
    12 min
    Start
  54. 54
    Find and stop a runaway process
    A background job is filling a log file and will not stop on its own. Find which process is writing it, identify it, and kill it.
    14 min
    Start
  55. 55
    Capstone, turn a log into a report
    An open-ended problem with no prescribed pipeline. Read an access log, count requests and errors per client IP, and write a sorted CSV. Any approach that produces the right report passes, the checks grade the output, not the keystrokes.
    25 min
    Start