Chapter 3: Bash Get Started

Bash Get Started day — the exact moment you stop being scared of the terminal and start becoming its boss! 😎

I’m going to walk you through how to actually begin using Bash right now, step-by-step, like we’re sitting side-by-side in Hyderabad at your laptop. No rush, lots of examples, copy-paste ready commands, and zero boring theory dumps.

This guide is for absolute beginners who have never written a Bash script before (or maybe typed only 2-3 commands in terminal). By the end, you’ll have run your first real script and understand the setup.

Step 1: Make Sure You Have Bash (99% chance you already do)

Open your terminal right now:

  • Ubuntu / Linux Mint / Pop!_OS → press Ctrl + Alt + T
  • macOS → Spotlight (Cmd + Space) → type “Terminal”
  • Windows → one of these three (easiest first):
    1. Git Bash (if you installed Git for Windows)
    2. Windows Terminal + WSL Ubuntu (very recommended in 2026)
    3. PowerShell (but we’ll pretend it’s Bash — better install Git Bash or WSL)

Now type this and press Enter:

Bash

You should see something like:

text

If you see version 4.x or 5.x → perfect! You’re ready. If command not found → tell me your OS and we’ll fix it together.

Extra quick check (very useful forever):

Bash

→ usually shows /usr/bin/bash or /bin/bash

Step 2: Your First 5 Survival Commands (Practice these 10 times today!)

Before scripting, get comfortable typing:

  1. Where am I?
    Bash
  2. What files are here? (detailed + hidden)
    Bash
  3. Go to your home (safest place)
    Bash
  4. Make a playground folder
    Bash
  5. Create an empty file
    Bash

Do these now — feel how fast it becomes muscle memory!

Step 3: Choose Your Text Editor (pick one — don’t overthink)

You need something to write scripts. Options from easiest to powerful:

Editor How to open in terminal Best for beginners? Installed by default?
nano nano myscript.sh ★★★★★ Yes! Almost always
gedit gedit myscript.sh ★★★★ Ubuntu yes
code (VS Code) code myscript.sh ★★★★ If you installed VS Code
vim vim myscript.sh ★★ (steep learning) Yes

Recommendation for today → nano (super simple)

Step 4: Write & Run Your VERY FIRST Bash Script (Hello World style)

  1. Make sure you’re in the playground folder:

    Bash
  2. Create the file:

    Bash
  3. Copy-paste exactly this (very important — first line is magic):

    Bash
  4. Save & exit nano:

    • Ctrl + O → Enter (save)
    • Ctrl + X (exit)
  5. Make it executable (super important — otherwise Bash says “permission denied”):

    Bash

    (You only do this once per script)

  6. Run it! Two ways:

    Bash

You should see beautiful output like:

text

Celebrate! 🥳 You wrote + executed code!

Step 5: Quick Upgrade – Make It Ask Your Name (Interactive!)

Edit the same file again:

Bash

Replace everything with this better version:

Bash

Save → chmod again if needed → run ./first.sh

Now it talks to you!

Step 6: Good Habits Checklist (Teacher’s Golden Rules)

Do these every time you make a new script:

  • Always start with #!/bin/bash (shebang line — tells system “use Bash”)
  • Use .sh extension (helps you recognize it)
  • chmod +x filename.sh before first run
  • Run with ./filename.sh (the ./ means “in current folder”)
  • Put scripts in ~/bin later (advanced — auto-run from anywhere)
  • Add comments with # so future-you understands

Bad example (don’t do):

Bash

Good example:

Bash

Step 7: Your 7-Day Get-Started Plan (Do this!)

Day 1 (today): Do all steps above + run the two scripts 5 times Day 2: Make a script that shows free disk space (df -h) + battery (if laptop) Day 3: Script that creates backup of ~/Documents folder Day 4: Add colors to echo (search “bash echo color”) Day 5-7: Try small tasks — rename files, count lines, etc.

Where to Go Next (free & best in 2026)

  • Ryan’s Tutorials → https://ryanstutorials.net/bash-scripting-tutorial/ (very clear, step-by-step)
  • freeCodeCamp Bash article → search “freecodecamp bash scripting tutorial”
  • YouTube: “Learn Bash Scripting in 1 Hour” by NetworkChuck or freeCodeCamp
  • Official: tldp.org Bash Beginners Guide (classic, free PDF)

Tell your teacher what happened when you ran ./first.sh — did it work? Any error? Or say next topic: “Explain variables in Bash” “Show me 5 useful small scripts” “How to add if-else” “Make script run every morning automatically”

You’re officially started now — no going back! Keep typing, keep breaking, keep fixing. All the best from your Hyderabad Bash guru! 🐧🇮🇳

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *