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):
- Git Bash (if you installed Git for Windows)
- Windows Terminal + WSL Ubuntu (very recommended in 2026)
- PowerShell (but we’ll pretend it’s Bash — better install Git Bash or WSL)
Now type this and press Enter:
|
0 1 2 3 4 5 6 |
bash --version |
You should see something like:
|
0 1 2 3 4 5 6 7 |
GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu) ... |
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):
|
0 1 2 3 4 5 6 7 |
echo $BASH_VERSION which 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:
- Where am I?
Bash0123456pwd
- What files are here? (detailed + hidden)
Bash0123456ls -la
- Go to your home (safest place)
Bash01234567cd ~# or just: cd
- Make a playground folder
Bash01234567mkdir bash_get_startedcd bash_get_started
- Create an empty file
Bash01234567touch practice.txtls
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)
-
Make sure you’re in the playground folder:
Bash0123456cd ~/bash_get_started -
Create the file:
Bash0123456nano first.sh -
Copy-paste exactly this (very important — first line is magic):
Bash0123456789101112131415161718#!/bin/bashecho "===================================="echo " Namaste from Hyderabad! 🚩 "echo " Your first Bash script works! "echo "===================================="echo ""echo "Today is: $(date)"echo "You are logged in as: $(whoami)"echo "Current folder: $(pwd)"echo ""echo "You just ran your first script — proud of you! 🎉" -
Save & exit nano:
- Ctrl + O → Enter (save)
- Ctrl + X (exit)
-
Make it executable (super important — otherwise Bash says “permission denied”):
Bash0123456chmod +x first.sh(You only do this once per script)
-
Run it! Two ways:
Bash012345678./first.sh# or full path:bash first.sh
You should see beautiful output like:
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
==================================== Namaste from Hyderabad! 🚩 Your first Bash script works! ==================================== Today is: Wed Feb 25 13:05:42 IST 2026 You are logged in as: webliance Current folder: /home/webliance/bash_get_started You just ran your first script — proud of you! 🎉 |
Celebrate! 🥳 You wrote + executed code!
Step 5: Quick Upgrade – Make It Ask Your Name (Interactive!)
Edit the same file again:
|
0 1 2 3 4 5 6 |
nano first.sh |
Replace everything with this better version:
|
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#!/bin/bash echo "What's your good name, boss?" read -r yourname echo "" echo "Arre waah, $yourname ji! Very nice to meet you 😄" echo "From now on I'll call you $yourname in all scripts." echo "" echo "Current time in Hyderabad: $(date '+%I:%M %p IST')" echo "Keep practicing — you're doing great!" |
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):
|
0 1 2 3 4 5 6 |
echo hi |
Good example:
|
0 1 2 3 4 5 6 7 8 |
#!/bin/bash # This script greets the user echo "Hi there!" |
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! 🐧🇮🇳
