Skip to content

Shell Scripting for Beginners

Learn to automate anything on the command line — in two weeks, starting from zero.

This course takes you from "what is a terminal?" to writing production-ready bash scripts that run on real servers. No prior programming experience required. You need a terminal and curiosity.


What You Will Build

By the end of Week 2 you will have written:

  • A system health monitor that alerts you when disk or memory runs low
  • A file organizer that automatically sorts downloads by file type
  • A log analyzer that parses real web server logs and generates reports
  • A backup script with rotation, timestamps, and incremental sync
  • A git hook collection that enforces code quality before every commit
  • A menu-driven CLI app with subcommands, a config file, and a help flag

Course Structure

Week 01 — Fundamentals Week 02 — Real Scripts
Day 1 Shell, terminal, files, permissions Functions and script structure
Day 2 Text processing and stream editing Error handling and arrays
Day 3 Variables, quoting, user input File operations and regex
Day 4 Control flow and loops Automation, cron, networking
Day 5 I/O, pipes, find Capstone + best practices

Prerequisites

  • A terminal. On Linux: any terminal emulator. On macOS: Terminal.app or iTerm2. On Windows: WSL2.
  • No prior programming experience required.
  • Bash 4.0 or later. Check with bash --version.

Windows users

Install WSL2 to get a real Linux environment inside Windows. This course does not cover PowerShell or CMD — bash is the target throughout.


How to Use This Course

  1. Read each section in order — concepts build on each other.
  2. Run every code example yourself. Type it; do not paste. Your hands need to learn the syntax.
  3. Do the practice exercises before moving on.
  4. Use the cheat sheets as reference after you have worked through the relevant day.
  5. The 6 guided projects are the real test — tackle at least two.

Best setup

Have two windows open side-by-side: this course on one side, a terminal on the other. Switch to the terminal for every example.


Quick Start

Open a terminal and run these three commands to verify your environment:

bash --version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

echo "Hello, shell"
Hello, shell

pwd
/home/user

If you see output similar to the above, you are ready.

Start here: day01-part1-shell-terminal


Designed and written by Nikhil Sharma.