Free course · 13 lessons · Beginner

Linux and Bash for Developers

The Linux and Bash skills developers need on real servers, taught through the problems you'll actually meet: disks that stay full after deleting files, permission errors after deploys, unquoted variables that delete the wrong files, logs that rotate but keep growing, ports already in use, file descriptor leaks, services that ignore stop signals, out-of-memory kills, slow shell loops, cron surprises, HTTP debugging with curl, and SSH keys and config. Every example is a real script run on Linux.

Start the course

1. Files, Disks and Permissions

Disk space that won't come back, permission errors during deploys, unquoted variables that delete the wrong files, and logs that rotate but keep growing.

  1. The Disk Is Full but du Finds Nothing — Find space held by deleted files that a running process still has open, and free it without a reboot.
  2. Permission Denied After a Deploy — Diagnose permission errors from file modes, directory execute bits and umask, and fix them without chmod 777.
  3. An Unquoted Variable Deleted the Wrong Files — See how word splitting and empty variables turn rm commands dangerous, and write cleanup scripts that can't delete the wrong thing.
  4. Logs Rotate but the Disk Keeps Filling — Understand why moving a log file doesn't stop a process writing to it, and rotate logs correctly with logrotate.

2. Processes and Resources

Ports already in use, too many open files, services that ignore stop signals, memory limits, and shell scripts that are slow for avoidable reasons.

  1. Address Already in Use — Find which process owns a port, stop it safely, and understand why a restarted server can't bind immediately.
  2. Too Many Open Files — Diagnose EMFILE errors, find descriptor leaks with /proc, and set limits the right way.
  3. The Service Ignores Stop Signals — See why wrapper scripts swallow SIGTERM, so deploys wait and then kill the app, and fix it with exec and traps.
  4. Out of Memory: Limits, Swapping and the OOM Killer — Understand what happens when a process runs out of memory, read the signs of the OOM killer, and set limits that fail predictably.
  5. A Shell Script That Takes Hours — Find why a text-processing script is slow (a new process per line) and rewrite it as a single pass with awk or sort.

3. Environment, Networking and Remote Access

Scripts that work in your terminal but not in cron, debugging HTTP connectivity from the command line, and SSH keys and configuration.

  1. It Works in My Terminal but Not in cron — Reproduce cron's minimal environment, and make scheduled scripts independent of your interactive shell setup.
  2. Debugging HTTP Calls from the Command Line — Tell apart connection refused, timeouts, TLS and HTTP errors with curl, and make scripted calls fail loudly.
  3. SSH Keys, Permissions and Config — Create SSH keys, fix 'unprotected private key' errors, and simplify connections with ~/.ssh/config and jump hosts.

4. Capstone

Investigate a misbehaving server and write the runbook.

  1. Capstone: Investigate a Slow Server and Write the Runbook — Work through a realistic Linux incident from first alert to root cause, and turn it into a runbook and preventive changes.

Was this page helpful?