This free shell scripting course walks you through Bash on Linux from first scripts to patterns you will reuse in automation, cron jobs, and one-off admin tasks. Each lesson is self-contained, but the chapters build in a sensible order: start with arguments and branching, strengthen variables and loops, then move into getopts, arrays, and small real-world utilities.
Use Start the course to open the first lesson, or jump to any chapter if you already know the basics. Every guide is written for copy-paste examples on common distros (RHEL family and Ubuntu).
If you landed here from an old Shell scripting category link on the site, this hub is the new home for that learning path.
How to use this course
Work through the chapters in order if you are new to Bash. Each lesson is short enough to finish in one sitting and includes commands you can run on a lab VM or your daily workstation. If you already script in another language, skim Getting Started and jump to Loops and Functions or Parsing Options with getopts when you need those patterns.
Keep a scratch directory for the examples. Name scripts with a .sh extension, mark them executable with chmod +x, and run them with an explicit interpreter (bash script.sh) until you are confident about the shebang line. When a lesson references Linux file permissions or redirection and pipes, those concepts are covered in the linked guides rather than repeated here.
What you need installed
| Requirement | Notes |
|---|---|
| Bash 4+ | Default on RHEL, Rocky, AlmaLinux, Ubuntu, and Debian |
| A text editor | vim, nano, or VS Code with a shell extension |
Optional: shellcheck |
Catches quoting and portability issues before you deploy a script |
Examples assume a normal user account with sudo when the task requires root. Cron, systemd timers, and bulk user creation lessons call out privilege requirements in the article body.
Topics covered in this course
| Chapter theme | What you will practice |
|---|---|
| Arguments and branching | Positional parameters, if/case, exit codes |
| Variables and loops | Strings, arithmetic, for/while, functions |
| Parsing and arrays | getopts, indexed and associative arrays |
| Real-world utilities | Calculators, progress bars, parallel job runners |
| Processes and timing | Lock files, execution timers, resource checks |
| Environment basics | .bashrc vs profile, login vs non-login shells |
When you outgrow one-off scripts, the natural next courses are Python for larger tooling and Ansible for fleet-wide automation.

