Become an AI Prompt Engineer

No Code, No Problem: How to Become an AI Prompt Engineer From Scratch
AI Prompt Engineering Career Beginners

No Code, No Problem: How to Become an AI Prompt Engineer From Scratch

Companies are paying people to talk to AI — and most of those people didn’t study computer science. Here’s how to get qualified, build a portfolio, and land the job.

Prompt engineering is one of the few genuinely new roles to emerge from the AI boom, and the barrier to entry is a clear head and decent writing skills — not a technical degree. You don’t need to understand neural networks. You need to understand how to communicate.

What Does a Prompt Engineer Actually Do?

A prompt engineer writes instructions for AI tools — precisely enough to get consistent, useful results. The AI does exactly what you tell it, so the quality of your instructions determines the quality of the output.

Consider this scenario: a company uses AI to handle customer enquiries. A vague prompt produces robotic, off-brand replies. A well-structured prompt produces responses that sound human and actually solve the problem. That gap is where prompt engineers earn their keep — and why businesses across marketing, legal, HR, and customer support are actively hiring for the skill.

· · ·

The Core Knowledge You Need

You don’t need to understand the math behind AI, but you do need to understand how it processes instructions. Large Language Models like ChatGPT, Claude, and Gemini don’t retrieve facts — they predict the most useful response based on what you give them. Clearer input produces better output.

The foundation is prompt structure. A solid prompt has four elements:

Example Prompt Structure
Role: “You are a professional copywriter.”
Context: “The audience is small business owners in Nigeria.”
Task: “Write a 3-sentence product description.”
Format: “Use bullet points.”

Test it yourself — ask ChatGPT to “write a product description,” then ask again using that structure. The difference in quality is immediate.

Free Resources to Start With

DeepLearning.AI short courses and Google’s Prompting Essentials guide are both free and built specifically for beginners. Either one will get you functional within a weekend.

· · ·

The Practical Skills Employers Look For

The most valued skill isn’t writing prompts — it’s diagnosing why they fail. Iteration is everything.

If you ask an AI to write a marketing email and it comes back too formal and too long, you don’t just try again. You adjust: “Keep it under 150 words, use a friendly conversational tone, and open with a question.” That kind of methodical troubleshooting is what separates a prompt engineer from someone who uses AI casually.

Beyond that, familiarity with tools like ChatGPT, Claude, and Midjourney is expected. Workflow automation tools like Zapier or Make — which connect AI outputs to real business processes — are a strong differentiator, and require no coding.

· · ·

How to Build Your Portfolio From Scratch

There are no formal qualifications in prompt engineering. Your portfolio is your credential — and you can start building it today.

A strong beginner project is a prompt experiment log: pick a use case — writing job descriptions for a fictional HR company, for instance — and document ten attempts. Record the original prompt, the output, what you changed, and why. It demonstrates exactly the analytical thinking employers want, costs nothing to make, and can be hosted on a free Notion page or GitHub repository.

· · ·

How to Land the Role

Update your LinkedIn headline to reflect the work — something like “AI Prompt Engineer | ChatGPT | Content Automation” — and frame your existing experience in relevant terms. A background in customer service, teaching, marketing, or writing is a genuine advantage here, not a consolation prize.

One candidate with a customer support background landed a prompt engineering role by reframing her experience: she’d spent years figuring out exactly what customers were really asking. That’s the core skill.

For job listings, check LinkedIn, Andela, and remote-focused boards like We Work Remotely. AI communities on Reddit (r/PromptEngineering), Discord, and X surface opportunities early and are worth joining before you’re actively job hunting.

· · ·

Start Today

Pick one thing from this post and do it now. Sign up for a free DeepLearning.AI course, write your first structured prompt, or open a Notion doc and start your experiment log. Prompt engineering is a skill built through practice — and the only way to fall behind is to wait.

© 2026 The AI Practitioner AI  ·  Careers  ·  Remote Work

30-Common Generative AI Tool List

Top 30 Free AI Tools

Comprehensive Guide to the Top 30 Free AI Tools for iOS and Android

The mobile landscape has been transformed by the rapid integration of artificial intelligence, offering users unprecedented capabilities directly from their smartphones. This guide reviews thirty of the most influential free AI tools available for iOS and Android, categorized by their functional impact. These applications leverage advanced machine learning models to enhance productivity, creativity, education, and personal well-being.

General Purpose AI Assistants

General-purpose AI assistants serve as versatile entry points for users seeking to leverage large language models for information retrieval, content generation, and task management.

Tool Best Use Case Core Strength
ChatGPT Conversational AI and coding Human-like text generation and complex reasoning.
Google Gemini Google ecosystem integration Multimodal interactions across Search, Gmail, and Docs.
Microsoft Copilot Search and Office productivity Web searches with citations and Office task assistance.
Perplexity AI Research and information discovery Real-time web citations and structured research threads.
Claude Nuanced writing and analysis Exceptional human-like tone and large text processing.

These assistants have evolved beyond simple chatbots into comprehensive workspaces. For instance, ChatGPT now supports file uploads and data analysis in its free tier, while Perplexity AI has redefined mobile search by providing direct answers instead of a list of links.

Productivity and Utility Applications

AI-powered utility tools focus on automating repetitive tasks, improving accessibility, and streamlining professional workflows.

Tool Best Use Case Core Strength
Otter.ai Meeting and lecture transcription Real-time audio-to-text with speaker identification.
Grammarly Writing and communication Real-time grammar, spelling, and tone adjustments.
Seeing AI Accessibility for the visually impaired Auditory descriptions of text, people, and objects.
Adobe Scan Document digitization High-quality OCR and automatic document detection.
SwiftKey Keyboard Enhanced typing and messaging Predictive text and integrated AI chat features.
Notion Workspace and knowledge management Automated summarization and action item generation.

Tools like Seeing AI demonstrate the profound social impact of AI, providing visual descriptions for those with sight impairments. Meanwhile, Otter.ai and Grammarly have become indispensable for students and professionals who need to maintain high standards of documentation and communication on the go.

Creativity and Media Editing

The creative sector has seen some of the most visible applications of AI, particularly in photo and video manipulation.

Tool Best Use Case Core Strength
Canva Graphic design and visual media Text-to-image generation and “Magic Edit” features.
Picsart AI All-in-one creative studio AI-driven background removal and artistic filters.
CapCut Mobile video production Automated captions and smart video templates.
Remini Photo restoration Enhancing low-resolution and blurry photographs.
FaceApp Portrait and selfie editing Realistic facial modifications and aging effects.
Luma AI 3D capture and cinematic video Creating 3D models and realistic video from text.
ElevenLabs Voice synthesis High-fidelity text-to-speech and voice cloning.
Pixlr Quick photo enhancements Generative fill and intelligent object removal.

Canva and Picsart have democratized design by integrating generative AI, allowing users to create professional-grade assets without specialized training. Luma AI represents the cutting edge of mobile creativity, enabling the generation of high-quality 3D assets and video directly from a mobile device.

Education and Language Learning

AI tools in education provide personalized tutoring and simplify complex subjects through interactive feedback.

Tool Best Use Case Core Strength
Duolingo Personalized language learning AI-driven lesson adaptation and speech practice.
ELSA Speak Pronunciation coaching Real-time feedback on English phonetic accuracy.
Socratic Academic tutoring Step-by-step explanations for math and science.
Photomath Mathematics problem solving OCR-based recognition of handwritten math equations.
LanguaTalk Conversational fluency AI-driven roleplay and instant voice corrections.

Duolingo remains a leader in the space by using AI to tailor the learning experience to the user’s pace. Specialized tools like ELSA Speak provide a level of phonetic feedback that was previously only available from human tutors.

Health, Wellness, and Companionship

Artificial intelligence is increasingly used to support mental health and personal organization through empathetic interaction and data-driven planning.

Tool Best Use Case Core Strength
Wysa Mental health support CBT-based chatbot for anxiety and stress relief.
Replika AI companionship Personalized emotional interaction and roleplay.
Woebot Mood tracking and coaching Daily check-ins and evidence-based coping tools.
FitnessAI Personalized physical training Optimization of workout routines based on data.
Calm Meditation and sleep Personalized recommendations for mindfulness.

Applications like Wysa and Woebot provide accessible mental health support using Cognitive Behavioral Therapy (CBT) techniques. While they do not replace professional medical advice, they offer valuable tools for daily stress management and emotional tracking.

AI Mastery Course 101

AI Mastery 2026 | 10-Day Training – itlearning.ng
Enrollment Open: March 2026 Cohort

AI Mastery 2026

10 Days. 10 Real Projects. CV & LinkedIn Optimization Included.

🚀 EARLY BIRD FLASH OFFER

₦50,000 ₦150,000

Approximately $35 USD for the first 50 sign-ups!

⚠️ Only 14 Early Bird spots remaining

CLAIM MY DISCOUNT NOW

What You Will Build

Go from zero to a 10-project GitHub portfolio

Day 01

The Prompt Engineer

Master the CO-STAR framework to get perfect AI responses every time.

Day 04

The Visual Creator

Design high-fidelity brand photography and AI-generated visuals.

Day 06

AI Cinema

Produce cinematic 4K video clips and trailers without a camera.

Day 08

The Bot Builder

Deploy a 24/7 AI chatbot that handles your support & leads automatically.

Day 09

Automation Guru

Connect 1,000+ apps using Zapier to work for you while you sleep.

Day 10 (Bonus)

The Career Optimizer

Live LinkedIn & CV Overhaul. Get noticed by high-paying recruiters.

Class Schedule: Mid-April 2026

Timezone: GMT+1 (Lagos)

Weekend Deep-Dives

April 18, 25.
May 2, 9, 16, 23, 30.
June 6, 13, 20

  • 11:00 AM – 1:00 PM
  • Hands-on Technical Builds

Weekday Sprints

Available on Request

  • 5:00 PM – 6:30 PM
  • Strategy & Live Q&A

Standard All-Access

₦150,000

or $100 USD

  • Full 10-Day Training Access
  • Professional AI CV Optimization
  • LinkedIn Algorithm Audit
Register Now

Start Your AI Journey

First 50 sign-ups pay only ₦50,000 / $35.

Secure Payment
Verification Process

© 2026 itlearning.ng AI Training. All rights reserved.

Cybersecurity Analyst Syllabus

Cybersecurity Analyst Syllabus

Cybersecurity Analyst Syllabus

Program Overview

A 6-month blended cybersecurity program combining:

  • 60 hours of live virtual instructor-led training
  • 24/7 online self-paced learning
  • Hands-on labs and simulations
  • Multi-cloud security (Azure, AWS, GCP)
  • Capstone project & certification preparation

Learning Outcomes

Learners will be able to:

  • Secure systems, networks, and cloud environments
  • Perform SOC monitoring & threat detection
  • Use SIEM tools (Splunk, ELK, Azure Sentinel)
  • Conduct digital forensics & malware analysis
  • Implement Zero Trust & NIST frameworks
  • Automate tasks (Python, Bash, PowerShell)
  • Secure Azure, AWS, and GCP environments
  • Conduct penetration testing basics
  • Understand GDPR/HIPAA compliance
  • Harden Linux/Windows systems
  • Prepare for cybersecurity job roles

24/7 Online Self-Paced Curriculum

Phase 0 — IT Foundations (Month 1)

  • Module 1: Computer Systems & OS
    • Computer hardware
    • Windows OS fundamentals
    • Linux basics
    • System monitoring
  • Module 2: Networking Fundamentals
    • OSI & TCP/IP models
    • Subnetting
    • DNS, DHCP, routing
    • Packet analysis (Wireshark)
  • Module 3: Scripting & Automation
    • Python for security
    • PowerShell
    • Bash scripting

Phase 1 — Junior Cybersecurity Analyst (Months 2–3)

  • Course 1: Security Foundations
    • CIA triad
    • NIST & ISO 27001
    • Threat landscape
  • Course 2: Network Security & Monitoring
    • Firewalls & VPNs
    • SIEM concepts
    • IDS/IPS
  • Course 3: Incident Response & Forensics
    • IR frameworks
    • Disk & memory forensics
    • Malware analysis
  • Course 4: Cloud Security & DevSecOps
    • Cloud security models
    • IAM
    • CI/CD security

Phase 2 — Intermediate Analyst (Months 4–6)

  • Course 5: Advanced Threats
    • APT analysis
    • MITRE ATT&CK
    • Penetration Testing Basics (Burp Suite, Nmap, Metasploit)
  • Course 6: Governance & Security Program
    • Security program design
    • GDPR/HIPAA compliance
    • Cloud governance

60-Hour Virtual Live Classroom Curriculum

Month 1 — Foundations (10 hours)

  • Windows & Linux admin labs
  • Networking labs (Wireshark, packet tracing)
  • Python live coding
  • Cloud setup workshop

Month 2 — Security Foundations (10 hours)

  • Risk assessment workshop
  • Threat intelligence mapping
  • Vulnerability scanning (Nessus/OpenVAS)
  • Security reporting

Month 3 — Network Security & SIEM (10 hours)

  • Firewall & VPN configuration
  • SIEM deployment (Splunk/ELK)
  • Log correlation workshop
  • PCAP forensics

Month 4 — Incident Response (10 hours)

  • IR tabletop exercises
  • Disk & memory forensics
  • Malware analysis
  • Threat hunting

Month 5 — Cloud & DevSecOps (10 hours)

  • Cloud hardening
  • IAM misconfigurations
  • CI/CD security
  • Container security

Month 6 — Advanced Security (10 hours)

  • Zero Trust design
  • SOAR automation
  • AI/ML security
  • Capstone project review

Capstone Project

Examples:

  • Multi-Cloud Threat Detection System
  • Cloud Hardening Blueprint (Azure/AWS/GCP)
  • SIEM Dashboards for Hybrid Cloud
  • Incident Response (IR) Playbook
  • Penetration Testing Report

Certification Roadmap

  • CompTIA Security+
  • CompTIA CySA+
  • Microsoft SC-900 / AZ-500
  • AWS Security Specialty
  • Google Professional Cloud Security Engineer
  • ISC2 CC

Policies & Expectations

  • 80% attendance mandatory
  • Completion of hands-on labs
  • Academic integrity enforced
  • Professional communication in all interactions

Career Preparation

  • Resume Tips & LinkedIn Profile Optimization
  • Interview Q&A (SOC/Cloud Security)
  • Mock Interviews with Industry Experts
  • Job Search Strategies

Cyber Security Analyst Program Syllabus

Cyber Security Analyst Program Syllabus

CYBER SECURITY ANALYST

Official Training Program Syllabus

1. Program Overview

The Cyber Security Analyst program is a 6‑month blended learning experience combining:

  • 60 hours of live virtual instructor‑led training
  • 24/7 online self‑paced learning resources
  • Hands‑on labs, simulations, and case studies
  • Capstone project and portfolio development
  • Certification preparation (Security+, CySA+, CC, Azure Security)

This program prepares learners for roles such as Cybersecurity Analyst, SOC Analyst, Incident Response Analyst, Threat Intelligence Analyst, and Security Operations Engineer.

2. Learning Outcomes

Learners will be able to:

  • Analyze and secure networks, systems, and cloud environments
  • Perform threat detection, log analysis, and incident response
  • Use SIEM tools (Splunk, ELK, Azure Sentinel)
  • Conduct digital forensics and malware analysis
  • Implement security controls and hardening techniques
  • Build automation scripts using Python, Bash, and PowerShell
  • Apply NIST, ISO 27001, and Zero Trust frameworks
  • Produce professional security reports and IR playbooks
  • Build a cybersecurity portfolio for job readiness

3. 24/7 Online Self‑Paced Curriculum

Phase 0 — IT Foundations (Month 1)

Module 1: Computer Systems & OS

  • Computer hardware
  • Windows OS fundamentals
  • Linux basics
  • System monitoring

Module 2: Networking Fundamentals

  • OSI & TCP/IP models
  • Subnetting
  • DNS, DHCP, routing
  • Packet analysis

Module 3: Scripting & Automation

  • Python for security
  • PowerShell
  • Bash scripting

Phase 1 — Junior Cybersecurity Analyst (Months 2–7)

Course 1: Security Foundations

  • CIA triad
  • NIST & ISO 27001
  • Threat landscape

Course 2: Network Security & Monitoring

  • Firewalls & VPNs
  • SIEM concepts
  • IDS/IPS

Course 3: Incident Response & Forensics

  • IR frameworks
  • Disk & memory forensics
  • Malware analysis

Course 4: Cloud Security & DevSecOps

  • Cloud security models
  • IAM
  • CI/CD security

Phase 2 — Intermediate Analyst (Months 8–10)

Course 6: Advanced Threats

  • APT analysis
  • MITRE ATT&CK

Course 7: Governance & Security Program

  • Security program design

4. 60‑Hour Virtual Live Classroom Curriculum

Month 1 — Foundations (10 hours)

  • Windows & Linux admin labs
  • Networking labs (Wireshark, packet tracing)
  • Python live coding
  • Cloud setup workshop

Month 2 — Security Foundations (10 hours)

  • Risk assessment workshop
  • Threat intelligence mapping
  • Vulnerability scanning (Nessus/OpenVAS)
  • Security reporting

Month 3 — Network Security & SIEM (10 hours)

  • Firewall & VPN configuration
  • SIEM deployment (Splunk/ELK)
  • Log correlation workshop
  • PCAP forensics

Month 4 — Incident Response (10 hours)

  • IR tabletop exercises
  • Disk & memory forensics
  • Malware analysis
  • Threat hunting

Month 5 — Cloud & DevSecOps (10 hours)

  • Cloud hardening
  • IAM misconfigurations
  • CI/CD security
  • Container security

Month 6 — Advanced Security (10 hours)

  • Zero Trust design
  • SOAR automation
  • AI/ML security
  • Capstone project review

5. Assessment Structure

  • Weekly quizzes
  • Lab submissions
  • Mid‑program practical exam
  • Capstone project
  • Portfolio review
  • Mock interview

6. Capstone Project

Learners complete a real‑world project such as:

  • SOC investigation report
  • Incident response playbook
  • SIEM dashboard + detection rules
  • Cloud security hardening blueprint
  • Malware analysis report

7. Certification Roadmap

  • CompTIA Security+
  • CompTIA CySA+
  • Cisco CC
  • Microsoft SC‑900 / AZ‑500
  • ISC2 CC

8. Policies & Expectations

  • 80% attendance for live sessions
  • Mandatory lab completion
  • Academic integrity
  • Professional communication

© 2024 Cyber Security Analyst Training Program

Bash & PowerShell Scripting Part-2

20 Scripts Every Beginner Should Write

📚 20 Scripts Every Beginner Should Write

Master Bash & PowerShell by building real scripts that solve actual problems. Each script builds on the previous one!

⏱️ Progressive Learning Path • 🎯 Beginner to Confident
Script #1

Hello World Beginner

📝 Display a simple message to the screen

🎯
What You’ll Learn Basic output, running scripts
⏱️
Estimated Time 5 minutes
🔧
Tools Needed Terminal/PowerShell, text editor

🎓 Concepts Covered

  • How to create a script file
  • Basic output commands
  • Running your first script
  • Understanding script syntax

📋 Step-by-Step Instructions

Create a new file

Bash: Create a file called hello.sh

PowerShell: Create a file called hello.ps1

Use any text editor like Notepad, nano, vim, or VS Code.

Write the code

Type the script code shown below. The echo command (Bash) or Write-Host (PowerShell) displays text on the screen.

Save the file

Save your script in a location you can easily find, like your home directory or Desktop.

Make it executable (Bash only)

In terminal, run: chmod +x hello.sh

This gives the script permission to run.

Run the script

Bash: ./hello.sh

PowerShell: .\hello.ps1

💻 Complete Code

Bash (hello.sh)
#!/bin/bash
# My first Bash script

echo "Hello, World!"
echo "Welcome to scripting!"
PowerShell (hello.ps1)
# My first PowerShell script

Write-Host "Hello, World!"
Write-Host "Welcome to scripting!"

▶️ Sample Output

Expected output:
Hello, World! Welcome to scripting!

🎨 3 Ways to Customize

  1. Add more messages: Add additional echo or Write-Host lines with different text
  2. Use colors (PowerShell): Try Write-Host “Hello!” -ForegroundColor Green
  3. Add ASCII art: Display fun text art like:
      _   _      _ _       
     | | | | ___| | | ___  
     | |_| |/ _ \ | |/ _ \ 
     |  _  |  __/ | | (_) |
     |_| |_|\___|_|_|\___/

⚠️ Common Mistakes

  • Forgetting the shebang (Bash): The #!/bin/bash line tells the system how to run the script
  • Wrong file extension: Use .sh for Bash and .ps1 for PowerShell
  • Not making executable (Bash): Must run chmod +x before running
  • Typos in commands: Commands must be spelled exactly right (case matters in Bash!)

✅ Success Criteria

You’ve succeeded if:

  • The script runs without errors
  • You see “Hello, World!” displayed on the screen
  • You can run the script multiple times
Script #2

Personal Greeting Beginner

📝 Greet yourself using variables to store your name

🎯
What You’ll Learn Variables, string manipulation
⏱️
Estimated Time 8 minutes
🔧
Tools Needed Terminal/PowerShell, text editor

🎓 Concepts Covered

  • Creating and using variables
  • Storing text (strings) in variables
  • Combining variables with text
  • Variable naming conventions

📋 Step-by-Step Instructions

Understand variables

Variables are like labeled boxes that store information. You can put a value in the box and use it later.

Bash syntax: name=”value” (no spaces around =)

PowerShell syntax: $name = “value” (spaces OK)

Create variables for personal info

Store your name, age, and city in separate variables.

Display the greeting

Use the variables in your echo/Write-Host statements. In Bash, use $variable to access the value. PowerShell is the same!

Run and test

Execute your script and verify it displays your personal information correctly.

💻 Complete Code

Bash (greeting.sh)
#!/bin/bash
# Personal greeting with variables

name="Sarah"
age=25
city="Portland"

echo "=============================="
echo "     PERSONAL PROFILE"
echo "=============================="
echo ""
echo "Name: $name"
echo "Age: $age years old"
echo "City: $city"
echo ""
echo "Hello, $name! Welcome to scripting from $city!"
PowerShell (greeting.ps1)
# Personal greeting with variables

$name = "Sarah"
$age = 25
$city = "Portland"

Write-Host "==============================" -ForegroundColor Cyan
Write-Host "     PERSONAL PROFILE" -ForegroundColor Cyan
Write-Host "==============================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Name: $name"
Write-Host "Age: $age years old"
Write-Host "City: $city"
Write-Host ""
Write-Host "Hello, $name! Welcome to scripting from $city!" -ForegroundColor Green

▶️ Sample Output

Expected output:
============================== PERSONAL PROFILE ============================== Name: Sarah Age: 25 years old City: Portland Hello, Sarah! Welcome to scripting from Portland!

🎨 3 Ways to Customize

  1. Add more fields: Include favorite color, hobby, or occupation
  2. Calculate birth year: Add birth_year=$((2025 – age)) and display it
  3. Create a bio paragraph: Combine all variables into one personalized story

⚠️ Common Mistakes

  • Spaces around = (Bash): name = “Sarah” won’t work—must be name=”Sarah”
  • Forgetting $ when using variable: echo name prints “name” literally, not the value
  • Quotes matter: Use quotes for text values to avoid issues with spaces
  • Case sensitivity (Bash): $Name and $name are different variables!

✅ Success Criteria

You’ve succeeded if:

  • Your script displays all three pieces of information
  • Variables are correctly inserted into sentences
  • You can change variable values and see updated output
Script #3

Interactive Echo Beginner

📝 Ask the user for input and echo it back

🎯
What You’ll Learn User input, interactive scripts
⏱️
Estimated Time 10 minutes
🔧
Tools Needed Terminal/PowerShell

🎓 Concepts Covered

  • Reading user input
  • Storing input in variables
  • Making scripts interactive
  • Prompting users effectively

📋 Step-by-Step Instructions

Learn the input commands

Bash: read variable_name waits for user input

PowerShell: Read-Host “prompt” asks and stores input

Ask multiple questions

Prompt the user for their name, favorite color, and a number. Store each response in a variable.

Echo back the responses

Display all the information the user provided in a friendly format.

💻 Complete Code

Bash (echo_input.sh)
#!/bin/bash
# Interactive input and echo

echo "===== Interactive Echo Program ====="
echo ""

echo "What is your name?"
read name

echo "What is your favorite color?"
read color

echo "Pick a number between 1 and 100:"
read number

echo ""
echo "===== Here's what you told me ====="
echo "Name: $name"
echo "Favorite Color: $color"
echo "Lucky Number: $number"
echo ""
echo "Nice to meet you, $name! $color is a great color!"
PowerShell (echo_input.ps1)
# Interactive input and echo

Write-Host "===== Interactive Echo Program =====" -ForegroundColor Cyan
Write-Host ""

$name = Read-Host "What is your name?"
$color = Read-Host "What is your favorite color?"
$number = Read-Host "Pick a number between 1 and 100"

Write-Host ""
Write-Host "===== Here's what you told me =====" -ForegroundColor Yellow
Write-Host "Name: $name"
Write-Host "Favorite Color: $color"
Write-Host "Lucky Number: $number"
Write-Host ""
Write-Host "Nice to meet you, $name! $color is a great color!" -ForegroundColor Green

▶️ Sample Output

Example interaction:
===== Interactive Echo Program ===== What is your name? John What is your favorite color? Blue Pick a number between 1 and 100: 42 ===== Here’s what you told me ===== Name: John Favorite Color: Blue Lucky Number: 42 Nice to meet you, John! Blue is a great color!

🎨 3 Ways to Customize

  1. Add more questions: Ask about age, city, hobby, or favorite food
  2. Do math with the number: Multiply their number by 2 and show the result
  3. Hidden input (Bash): Use read -s password for secret input (like passwords)

⚠️ Common Mistakes

  • Not waiting for input: Make sure your script pauses for the user to type
  • Empty inputs: Users might press Enter without typing anything
  • Spelling variable names: If you store in $name, you must use $name (not $username)

✅ Success Criteria

You’ve succeeded if:

  • Script asks questions and waits for answers
  • All inputs are correctly echoed back
  • The conversation feels natural and friendly
Script #4

Simple Calculator Easy

📝 Perform basic math operations on user-provided numbers

🎯
What You’ll Learn Arithmetic operations, number handling
⏱️
Estimated Time 12 minutes
🔧
Tools Needed Terminal/PowerShell

🎓 Concepts Covered

  • Mathematical operations (+, -, *, /)
  • Working with numbers in scripts
  • Converting string input to numbers
  • Displaying calculated results

📋 Step-by-Step Instructions

Understand arithmetic syntax

Bash: Use $((expression)) for math, e.g., $((5 + 3))

PowerShell: Math works directly, but convert input with [int]$variable

Get two numbers from user

Prompt for two numbers and store them in variables.

Perform all operations

Calculate sum, difference, product, and quotient. Store each result in its own variable.

Display results

Show all calculated results in a clear, formatted way.

💻 Complete Code

Bash (calculator.sh)
#!/bin/bash
# Simple calculator

echo "====== Simple Calculator ======"
echo ""

read -p "Enter first number: " num1
read -p "Enter second number: " num2

# Perform calculations
sum=$((num1 + num2))
difference=$((num1 - num2))
product=$((num1 * num2))
quotient=$((num1 / num2))

# Display results
echo ""
echo "====== Results ======"
echo "$num1 + $num2 = $sum"
echo "$num1 - $num2 = $difference"
echo "$num1 × $num2 = $product"
echo "$num1 ÷ $num2 = $quotient"
echo ""
echo "Thanks for calculating!"
PowerShell (calculator.ps1)
# Simple calculator

Write-Host "====== Simple Calculator ======" -ForegroundColor Cyan
Write-Host ""

$num1 = Read-Host "Enter first number"
$num2 = Read-Host "Enter second number"

# Convert to integers and perform calculations
$num1 = [int]$num1
$num2 = [int]$num2

$sum = $num1 + $num2
$difference = $num1 - $num2
$product = $num1 * $num2
$quotient = $num1 / $num2

# Display results
Write-Host ""
Write-Host "====== Results ======" -ForegroundColor Yellow
Write-Host "$num1 + $num2 = $sum" -ForegroundColor Green
Write-Host "$num1 - $num2 = $difference" -ForegroundColor Green
Write-Host "$num1 × $num2 = $product" -ForegroundColor Green
Write-Host "$num1 ÷ $num2 = $quotient" -ForegroundColor Green
Write-Host ""
Write-Host "Thanks for calculating!" -ForegroundColor Cyan

▶️ Sample Output

Example with inputs 10 and 5:
====== Simple Calculator ====== Enter first number: 10 Enter second number: 5 ====== Results ====== 10 + 5 = 15 10 – 5 = 5 10 × 5 = 50 10 ÷ 5 = 2 Thanks for calculating!

🎨 3 Ways to Customize

  1. Add modulo operation: Show remainder with $((num1 % num2))
  2. Add exponentiation: Calculate $((num1 ** num2)) (num1 to the power of num2)
  3. Check for division by zero: Add a warning if num2 is 0 before dividing

⚠️ Common Mistakes

  • Forgetting $(( )) in Bash: Math operations need double parentheses
  • Not converting to numbers (PowerShell): Input is text by default—convert with [int]
  • Division by zero: If user enters 0 as second number, division fails
  • Integer division: 10 / 3 = 3 (not 3.33) unless you handle decimals specially

✅ Success Criteria

You’ve succeeded if:

  • All four operations calculate correctly
  • Results match what you’d expect from a calculator
  • Script works with different number combinations
Script #5

File Creator Easy

📝 Create a new text file with user-provided content

🎯
What You’ll Learn File creation, writing to files
⏱️
Estimated Time 12 minutes
🔧
Tools Needed Terminal/PowerShell

🎓 Concepts Covered

  • Creating files from scripts
  • Writing text to files
  • File redirection (>, >>)
  • Working with file paths

💻 Complete Code

Bash (file_creator.sh)
#!/bin/bash
# Create a file with user content

echo "====== File Creator ======"
echo ""

read -p "Enter filename (e.g., mynotes.txt): " filename
read -p "Enter file content: " content

# Create the file with content
echo "$content" > "$filename"

if [ -f "$filename" ]; then
    echo ""
    echo "✓ File '$filename' created successfully!"
    echo "Content: $content"
    echo "Location: $(pwd)/$filename"
else
    echo "✗ Error: Failed to create file"
fi
PowerShell (file_creator.ps1)
# Create a file with user content

Write-Host "====== File Creator ======" -ForegroundColor Cyan
Write-Host ""

$filename = Read-Host "Enter filename (e.g., mynotes.txt)"
$content = Read-Host "Enter file content"

# Create the file with content
$content | Out-File $filename

if (Test-Path $filename) {
    Write-Host ""
    Write-Host "✓ File '$filename' created successfully!" -ForegroundColor Green
    Write-Host "Content: $content"
    Write-Host "Location: $(Get-Location)\$filename"
}
else {
    Write-Host "✗ Error: Failed to create file" -ForegroundColor Red
}

▶️ Sample Output

Example interaction:
====== File Creator ====== Enter filename (e.g., mynotes.txt): test.txt Enter file content: This is my first file! ✓ File ‘test.txt’ created successfully! Content: This is my first file! Location: /home/user/test.txt

🎨 3 Ways to Customize

  1. Add timestamp: Include creation date/time in the file
  2. Multiple lines: Allow user to enter multiple lines of content
  3. Choose directory: Let user specify where to save the file

⚠️ Common Mistakes

  • Overwriting files: Using > replaces existing files—check if file exists first
  • Special characters in filename: Avoid spaces and symbols like /, \, :, *, ?
  • File permissions: Make sure you have write permission in the directory

✅ Success Criteria

You’ve succeeded if:

  • A new file appears in your directory
  • Opening the file shows the content you entered
  • Success message displays the correct file path
Script #6

File Info Display Easy

📝 Show detailed information about a file

🎯
What You’ll Learn File properties, conditionals
⏱️
Estimated Time 15 minutes
🔧
Tools Needed Terminal/PowerShell

🎓 Concepts Covered

  • Checking if files exist
  • Reading file properties (size, date)
  • Basic if-statements
  • File tests and conditions

💻 Complete Code

Bash (file_info.sh)
#!/bin/bash
# Display file information

echo "====== File Information Display ======"
echo ""

read -p "Enter filename: " filename

if [ -f "$filename" ]; then
    echo ""
    echo "File: $filename"
    echo "Size: $(wc -c < "$filename") bytes"
    echo "Lines: $(wc -l < "$filename")"
    echo "Words: $(wc -w < "$filename")"
    echo "Modified: $(stat -c %y "$filename" 2>/dev/null || stat -f %Sm "$filename")"
    echo ""
    echo "--- First 5 lines ---"
    head -5 "$filename"
else
    echo "✗ Error: File '$filename' not found"
fi
PowerShell (file_info.ps1)
# Display file information

Write-Host "====== File Information Display ======" -ForegroundColor Cyan
Write-Host ""

$filename = Read-Host "Enter filename"

if (Test-Path $filename) {
    $file = Get-Item $filename
    $content = Get-Content $filename
    
    Write-Host ""
    Write-Host "File: $($file.Name)" -ForegroundColor Yellow
    Write-Host "Size: $($file.Length) bytes"
    Write-Host "Lines: $($content.Count)"
    Write-Host "Modified: $($file.LastWriteTime)"
    Write-Host ""
    Write-Host "--- First 5 lines ---" -ForegroundColor Cyan
    $content | Select-Object -First 5
}
else {
    Write-Host "✗ Error: File '$filename' not found" -ForegroundColor Red
}

▶️ Sample Output

Example output:
====== File Information Display ====== Enter filename: test.txt File: test.txt Size: 245 bytes Lines: 8 Words: 42 Modified: 2025-10-13 14:30:22 — First 5 lines — This is line 1 This is line 2 This is line 3 This is line 4 This is line 5

🎨 3 Ways to Customize

  1. Show last lines: Display the last 5 lines instead of first
  2. Calculate MB/GB: Convert bytes to megabytes for large files
  3. File type detection: Identify if it’s a text file, image, etc.

⚠️ Common Mistakes

  • File doesn’t exist: Always check with -f (Bash) or Test-Path (PowerShell)
  • Binary files: Don’t try to read binary files as text (images, executables)
  • File paths with spaces: Always quote variables: “$filename”

✅ Success Criteria

  • Script correctly identifies when file exists or doesn’t
  • All file properties display accurately
  • First 5 lines show correctly for text files

📚 Complete Script Index

Your complete learning journey from beginner to confident scripter

🎯 Scripts 1-5: Fundamentals

  1. Hello World – Basic output (5 min)
  2. Personal Greeting – Variables (8 min)
  3. Interactive Echo – User input (10 min)
  4. Simple Calculator – Math operations (12 min)
  5. File Creator – File writing (12 min)

🎯 Scripts 6-10: File Operations

  1. File Info Display – Reading properties (15 min)
  2. Multiple File Creator – Loops basics (18 min)
  3. File Organizer – Loops + conditions (20 min)
  4. Text Search – String searching (20 min)
  5. Backup Script – Copying with timestamps (25 min)

🎯 Scripts 11-15: Intermediate Skills

  1. Log File Cleaner – File deletion logic (25 min)
  2. Disk Space Monitor – System info (30 min)
  3. Process Lister – System processes (30 min)
  4. Password Generator – Random data (25 min)
  5. To-Do List Manager – File read/write/append (35 min)

🎯 Scripts 16-20: Advanced Integration

  1. User Account Creator – Input validation (40 min)
  2. System Health Report – Multiple checks (45 min)
  3. Automated Backup – Combining concepts (50 min)
  4. Log Analyzer – Text processing (50 min)
  5. Multi-Tool Menu – Complete application (60 min)

🎓 Learning Path Summary

  • Total Time: ~9 hours of hands-on practice
  • Progression: Each script builds on previous concepts
  • By Script 20: You’ll have a complete toolset of reusable scripts
  • Skill Level: From absolute beginner to confident scripter

✅ What You’ll Achieve

After completing all 20 scripts, you will be able to:

  • Write scripts confidently in both Bash and PowerShell
  • Automate everyday tasks and save hours of work
  • Handle files, directories, and system operations
  • Create interactive tools with menus and user input
  • Debug common errors and customize existing scripts
  • Read and understand other people’s scripts
  • Build your own automation tools from scratch
📖 Script 1/20

Bash & PowerShell Scripting Part-1

Bash & PowerShell Scripting for Absolute Beginners

🚀 Bash & PowerShell Scripting
for Absolute Beginners

Learn to automate tasks and save hours of work with simple scripts. No programming experience needed!

⏱️ ~2.5 hours of learning ahead
Start scrolling to track your progress!

1. What is Scripting and Why Should You Care?

Welcome! Let’s Start Simple

Congratulations on taking the first step into the world of scripting! You’re about to learn something that will save you countless hours and make you look like a tech wizard to your friends and colleagues.

But first, let’s answer the big question: What exactly is scripting?

🍳 The Recipe Analogy

Think of a script like a recipe. When you make pancakes, you follow steps:

  1. Mix flour, eggs, and milk
  2. Heat the pan
  3. Pour batter
  4. Flip when bubbles appear
  5. Serve with syrup

A script is the same thing—it’s a list of instructions for your computer to follow automatically. Instead of you clicking buttons and typing things manually, the computer reads your “recipe” and does all the steps for you!

Why Scripting is Your New Superpower

Imagine if you had to:

  • Rename 500 files (would take hours manually!)
  • Back up important folders every day
  • Create user accounts for 50 new employees
  • Check if your servers are running every morning

With scripting, you write the instructions once, and the computer does the work thousands of times without complaining, making mistakes, or needing coffee breaks!

Manual Work vs. Scripted Work

Manual: 4 hours
Script: 10 seconds

Write once, run forever!

Meet Your Two New Friends: Bash and PowerShell

Think of Bash and PowerShell as two different languages that computers understand. They both help you automate tasks, but they’re used in different situations:

Bash PowerShell
🐧 Used on Linux/Mac computers 🪟 Used on Windows computers (but also works on Linux/Mac!)
Simple, concise commands More descriptive, English-like commands
Example: ls (list files) Example: Get-ChildItem (get files)
Popular in web servers, DevOps Popular in IT administration, system management

💡 Good News!

The concepts you learn apply to both languages! It’s like learning to drive—once you know the basics, you can drive different cars. We’ll show you how to do the same task in both Bash and PowerShell throughout this guide.

⚠️ Common Confusion: Script vs. Program

Scripts are usually simpler, text-based instructions that run line-by-line. You can open and read them like a text file.

Programs (like Microsoft Word or Chrome) are compiled, complex applications that have been converted into computer code.

Think of it this way: A script is like a handwritten recipe; a program is like a cake-making machine in a factory.

🎯 Try It Now: Open Your Terminal/Shell

On Windows:

  1. Press Windows Key + R
  2. Type powershell and press Enter
  3. A blue window appears—that’s PowerShell!

On Mac:

  1. Press Command + Space
  2. Type terminal and press Enter
  3. A white or black window appears—that’s your Terminal!

On Linux:

  1. Press Ctrl + Alt + T
  2. Your terminal opens automatically!

Success! If you see a window with text and a blinking cursor, you did it! Don’t worry if it looks intimidating—we’ll make it friendly.

Checkpoint #1 (10 minutes)

What you’ve learned so far:

  • Scripts are lists of instructions for computers
  • They save you from repetitive manual work
  • Bash and PowerShell are two popular scripting languages
  • You successfully opened your terminal/shell!

🎉 Great start! Take a 2-minute break, stretch, then continue to Section 2.

2. Your First Commands: Talking to Your Computer

Understanding the Command Line

That window you opened? It’s called a terminal (Mac/Linux) or shell (Windows). Think of it as a text-based conversation with your computer.

💬 The Text Message Analogy

Using the command line is like texting your computer:

  • You: Type a command (your message)
  • Computer: Reads it and responds
  • You: Send another command based on the response

It’s a back-and-forth conversation, except your computer follows instructions exactly as you type them!

Your First Command: Hello, World!

Let’s make your computer say something. This is the traditional first step for all programmers!

Simple

Bash: Display Text

echo "Hello, World!"

What this does: The computer prints “Hello, World!” to the screen.

Breaking it down:

  • echo = the command to display text
  • “Hello, World!” = the text to display
Simple

PowerShell: Display Text

Write-Host "Hello, World!"

What this does: Same thing—displays “Hello, World!”

Breaking it down:

  • Write-Host = command to write to screen
  • “Hello, World!” = the text to display

💡 Notice the Pattern?

Every command has this structure:

COMMAND
+
WHAT TO DO WITH

It’s like English: “Verb + Object” → “Display this text” or “List these files”

Useful Everyday Commands

Let’s learn commands you’ll use all the time. These are like the basic vocabulary words in any language.

Medium

Show Current Location

Bash:

pwd

PowerShell:

Get-Location

What it does: Shows which folder you’re currently in (like checking “You Are Here” on a mall map)

Output example: /home/username or C:\Users\username

Medium

List Files in Current Folder

Bash:

ls

PowerShell:

Get-ChildItem

What it does: Shows all files and folders where you are (like opening a drawer and seeing what’s inside)

You’ll see: Names of files and folders in that location

Practical

Change to a Different Folder

Bash:

cd Documents

PowerShell:

Set-Location Documents

What it does: Moves you into the Documents folder (like walking into a different room in your house)

Pro tip: Type cd .. to go back to the parent folder (like walking out of a room)

How Folders Work in the Command Line

Think of your computer as a house:

🏠 Home (your starting point)
├── 📁 Documents
│   ├── 📄 report.doc
│   └── 📄 notes.txt
├── 📁 Pictures
│   └── 🖼️ vacation.jpg
└── 📁 Downloads
    └── 📦 software.zip

When you cd Documents, you’re entering the Documents “room”

⚠️ Common Confusion: Case Sensitivity

Bash: Cares about uppercase/lowercase!

  • cd Documents works
  • cd documents might not work (if folder is “Documents”)

PowerShell: Doesn’t care about case

  • Set-Location Documents works
  • set-location documents also works!

🎯 Try It Now: Navigate Your Computer

Challenge: Let’s explore your computer using commands!

  1. Check where you are: Type pwd (Bash) or Get-Location (PowerShell)
  2. See what’s here: Type ls (Bash) or Get-ChildItem (PowerShell)
  3. Go to Documents: Type cd Documents (or Set-Location Documents)
  4. List files there: Use the list command again
  5. Go back home: Type cd (Bash) or Set-Location ~ (PowerShell)

Success! If you moved between folders and saw different files, you’re navigating like a pro!

Checkpoint #2 (25 minutes total)

What you’ve learned:

  • The command line is like a text conversation with your computer
  • Commands have a structure: COMMAND + WHAT
  • Basic commands: display text, show location, list files, change folders
  • Bash is case-sensitive; PowerShell isn’t
  • You navigated your file system using commands!

🎉 You’re doing great! Take a break, grab some water, and let’s move on to variables.

3. Variables: Giving Your Computer a Memory

What is a Variable?

Imagine you’re following a recipe, and it says “add the mixture.” But what’s “the mixture”? It’s whatever you created in step 3—maybe eggs and flour.

A variable is like a labeled container that holds information your computer needs to remember.

📦 The Box Analogy

Think of variables as labeled boxes:

📦 username
contains: “Sarah”
📦 age
contains: 25
📦 city
contains: “Portland”

You can:

  • Put things in the box (assign a value)
  • Look in the box (use the value)
  • Change what’s in the box (update the value)
  • Use what’s in multiple boxes together (combine values)

Creating Your First Variable

Simple

Bash: Create and Use a Variable

name="Alice"
echo "Hello, $name!"

Output: Hello, Alice!

Breaking it down:

  • name=”Alice” → Put “Alice” in a box labeled “name”
  • $name → Look in the box and use what’s inside
  • ⚠️ Notice: No spaces around the = sign!
Simple

PowerShell: Create and Use a Variable

$name = "Alice"
Write-Host "Hello, $name!"

Output: Hello, Alice!

Breaking it down:

  • $name = “Alice” → Create a variable
  • Notice the $ before the name—that’s how PowerShell knows it’s a variable
  • Spaces around = are fine in PowerShell!

💡 Key Difference

Bash: $ is used when you read the variable ($name)

PowerShell: $ is used when you create and read the variable ($name)

Types of Information You Can Store

Medium

Storing Numbers and Doing Math

Bash:

age=25
next_year=$((age + 1))
echo "Next year I'll be $next_year"

PowerShell:

$age = 25
$nextYear = $age + 1
Write-Host "Next year I'll be $nextYear"

Output: Next year I’ll be 26

What’s happening: We’re doing math! The computer calculates 25 + 1 and stores the result.

Medium

Combining Text (Concatenation)

Bash:

first_name="John"
last_name="Smith"
full_name="$first_name $last_name"
echo "Welcome, $full_name!"

PowerShell:

$firstName = "John"
$lastName = "Smith"
$fullName = "$firstName $lastName"
Write-Host "Welcome, $fullName!"

Output: Welcome, John Smith!

What’s happening: We’re gluing text together like building with LEGO blocks!

Practical

Real-World Example: File Backup

Bash:

today=$(date +%Y-%m-%d)
filename="backup_$today.tar.gz"
echo "Creating: $filename"

PowerShell:

$today = Get-Date -Format "yyyy-MM-dd"
$filename = "backup_$today.zip"
Write-Host "Creating: $filename"

Output: Creating: backup_2025-10-13.zip

Why this is useful: Every day, your backup file has a different name with the date! No more overwriting yesterday’s backup.

How Variables Flow in a Script

Step 1: Create variable
    📦 name = "Sarah"
    
Step 2: Use it later
    "Hello, Sarah!"  (pulled from the box)
    
Step 3: Change it
    📦 name = "Mike"  (replaced what's in the box)
    
Step 4: Use it again
    "Hello, Mike!"  (now uses the new value)

⚠️ Common Confusion: Quotes or No Quotes?

Text needs quotes:

  • name=”Alice”
  • name=Alice (might work but can cause problems)

Numbers don’t need quotes:

  • age=25
  • ⚠️ age=”25″ (works but treated as text, not a number)

Rule of thumb: When in doubt, use quotes! They rarely hurt and often help.

Naming Your Variables

Good variable names make your scripts easy to understand. It’s like labeling boxes clearly!

❌ Bad Names ✅ Good Names Why?
x username Descriptive and clear
temp current_temperature Says exactly what it holds
data1 user_email Specific purpose is obvious

💡 Naming Conventions

Bash style: my_variable_name (lowercase with underscores)

PowerShell style: $MyVariableName (PascalCase or camelCase)

Both work, but consistency makes your code easier to read!

🎯 Try It Now: Create a Personal Greeting Script

Your mission: Create a script that greets you personally!

For Bash users:

  1. Type: name=”YourName” (use your actual name!)
  2. Type: age=25 (use your actual age)
  3. Type: echo “Hi, I’m $name and I’m $age years old”
  4. Press Enter after each line

For PowerShell users:

  1. Type: $name = “YourName”
  2. Type: $age = 25
  3. Type: Write-Host “Hi, I’m $name and I’m $age years old”

Bonus Challenge: Add a third variable for your city and include it in your greeting!

Success! If you see your personalized greeting, you’ve mastered variables!

Checkpoint #3 (45 minutes total)

What you’ve learned:

  • Variables are labeled containers that store information
  • You can store text, numbers, and combine them
  • Bash uses $ when reading; PowerShell uses $ always
  • Good names make your scripts readable
  • You created your own personalized greeting!

🎉 Halfway there! You’re building real scripting skills. Take a 5-minute break!

4. Input & Output: Having a Conversation

Making Your Scripts Interactive

So far, we’ve been hardcoding values (writing them directly in the script). But what if you want your script to ask questions and respond based on the answers?

🎤 The Survey Analogy

Imagine you’re conducting a survey:

  1. You ask: “What’s your name?”
  2. Person responds: “Sarah”
  3. You record: Write “Sarah” on your clipboard
  4. You use it: “Thanks, Sarah! Next question…”

Scripts work the same way—they can ask questions, wait for answers, and then use those answers!

Getting Input from Users

Simple

Bash: Ask for Input

echo "What is your name?"
read name
echo "Hello, $name!"

What happens:

  1. Script asks the question
  2. Cursor blinks, waiting for you to type
  3. You type your name and press Enter
  4. Script greets you!

Key command: read gets input and stores it in a variable

Simple

PowerShell: Ask for Input

$name = Read-Host "What is your name?"
Write-Host "Hello, $name!"

What happens:

  1. Script displays the question
  2. Waits for your input
  3. Stores your answer in $name
  4. Uses it in the greeting

Key command: Read-Host asks and stores in one step!

Different Types of Output

We’ve been using echo and Write-Host, but there are other ways to show information:

Medium

Colorful Output (PowerShell)

Write-Host "Success!" -ForegroundColor Green
Write-Host "Warning!" -ForegroundColor Yellow
Write-Host "Error!" -ForegroundColor Red

Why it’s useful: Colors help users quickly understand if something worked or failed!

Colors available: Black, Blue, Cyan, Gray, Green, Magenta, Red, White, Yellow

Medium

Writing to a File Instead of Screen

Bash:

echo "Log entry: Process started" > log.txt
echo "Log entry: Task completed" >> log.txt

PowerShell:

"Log entry: Process started" | Out-File log.txt
"Log entry: Task completed" | Out-File log.txt -Append

What’s happening:

  • > or Out-File creates/overwrites the file
  • >> or -Append adds to the end without deleting what’s there
Practical

Real-World: User Registration Script

Bash:

echo "=== User Registration ==="
read -p "Enter your username: " username
read -p "Enter your email: " email
read -sp "Enter your password: " password
echo ""
echo "Registration complete for $username"
echo "$username registered on $(date)" >> users.log

PowerShell:

Write-Host "=== User Registration ===" -ForegroundColor Cyan
$username = Read-Host "Enter your username"
$email = Read-Host "Enter your email"
$password = Read-Host "Enter your password" -AsSecureString
Write-Host "Registration complete for $username" -ForegroundColor Green
"$username registered on $(Get-Date)" | Out-File users.log -Append

Cool features:

  • read -sp (Bash) hides password as you type
  • -AsSecureString (PowerShell) secures the password
  • Logs each registration with a timestamp

Input → Process → Output Flow

1. INPUT (User types)
   👤 User enters: "Tokyo"
   ↓
2. PROCESS (Script works)
   💾 Store in variable: city = "Tokyo"
   🧮 Maybe do calculations or checks
   ↓
3. OUTPUT (Show results)
   📺 Display: "Welcome to Tokyo!"
   📄 Save to file: "User visited Tokyo"

💡 Making Better Prompts

Instead of: “Enter value:”

Try: “Enter your age (18-100):”

Good prompts tell users:

  • What to enter
  • What format is expected
  • Any limits or requirements

It’s like giving clear directions instead of just saying “Go that way!”

⚠️ Common Confusion: When to Use Quotes in Output

Text needs quotes in the command:

  • echo “Hello”
  • echo Hello (works but can be tricky with spaces)

Variables inside quotes work automatically:

  • echo “Hi, $name” → “Hi, Sarah”
  • echo Hi, $name → might not work as expected

Rule of thumb: Always wrap your text and variables in quotes for reliable output!

🎯 Try It Now: Build a Simple Calculator

Challenge: Create a script that asks for two numbers and adds them!

For Bash:

echo "Simple Calculator"
read -p "Enter first number: " num1
read -p "Enter second number: " num2
result=$((num1 + num2))
echo "Result: $num1 + $num2 = $result"

For PowerShell:

Write-Host "Simple Calculator" -ForegroundColor Cyan
$num1 = Read-Host "Enter first number"
$num2 = Read-Host "Enter second number"
$result = [int]$num1 + [int]$num2
Write-Host "Result: $num1 + $num2 = $result" -ForegroundColor Green

Try it: Run this code and enter 10 and 5. You should see: Result: 10 + 5 = 15

Bonus Challenges:

  1. Change the + to – for subtraction
  2. Try multiplication (use * in Bash, same in PowerShell)
  3. Add a welcome message at the start
Checkpoint #4 (65 minutes total)

What you’ve learned:

  • Scripts can ask questions and get answers from users
  • Input: read (Bash), Read-Host (PowerShell)
  • Output can go to screen or files
  • Colors make output more user-friendly
  • You built an interactive calculator!

🎉 You’re over halfway! Your scripts are getting interactive. Quick stretch break!

5. Making Decisions: If This, Then That

Scripts That Make Choices

Real power comes when your script can make decisions based on situations. This is called “conditional logic” or “if-statements.”

🌦️ The Weather Analogy

Every morning you make a decision:

  • IF it’s raining → bring an umbrella
  • ELSE IF it’s sunny → wear sunglasses
  • ELSE (neither) → just go outside normally

Your script can make similar decisions! It checks conditions and does different things based on what it finds.

Your First If-Statement

Simple

Bash: Basic If-Statement

age=18

if [ $age -ge 18 ]; then
    echo "You can vote!"
else
    echo "Too young to vote"
fi

Breaking it down:

  • if [ condition ] = check if something is true
  • then = do this if true
  • else = otherwise, do this
  • fi = end of if-statement (“if” backwards!)

Comparison operators:

  • -eq = equal to
  • -ne = not equal
  • -gt = greater than
  • -ge = greater than or equal
  • -lt = less than
  • -le = less than or equal
Simple

PowerShell: Basic If-Statement

$age = 18

if ($age -ge 18) {
    Write-Host "You can vote!" -ForegroundColor Green
}
else {
    Write-Host "Too young to vote" -ForegroundColor Yellow
}

Breaking it down:

  • if (condition) = check if true
  • { } = curly braces contain the code to run
  • else { } = what to do otherwise

Comparison operators:

  • -eq = equal to
  • -ne = not equal
  • -gt = greater than
  • -ge = greater than or equal
  • -lt = less than
  • -le = less than or equal

💡 Notice the Pattern?

Both languages use the same operators for numbers! -ge, -lt, etc.

The main difference is syntax (how you write it), not the logic!

Multiple Conditions: If, Else If, Else

Medium

Grade Calculator

Bash:

score=85

if [ $score -ge 90 ]; then
    echo "Grade: A - Excellent!"
elif [ $score -ge 80 ]; then
    echo "Grade: B - Good job!"
elif [ $score -ge 70 ]; then
    echo "Grade: C - Average"
elif [ $score -ge 60 ]; then
    echo "Grade: D - Needs improvement"
else
    echo "Grade: F - Failed"
fi

PowerShell:

$score = 85

if ($score -ge 90) {
    Write-Host "Grade: A - Excellent!" -ForegroundColor Green
}
elseif ($score -ge 80) {
    Write-Host "Grade: B - Good job!" -ForegroundColor Cyan
}
elseif ($score -ge 70) {
    Write-Host "Grade: C - Average" -ForegroundColor Yellow
}
elseif ($score -ge 60) {
    Write-Host "Grade: D - Needs improvement" -ForegroundColor DarkYellow
}
else {
    Write-Host "Grade: F - Failed" -ForegroundColor Red
}

How it works: Script checks each condition in order until one is true, then stops.

Medium

Checking If Files Exist

Bash:

filename="data.txt"

if [ -f "$filename" ]; then
    echo "File exists! Reading..."
    cat "$filename"
else
    echo "File not found! Creating..."
    echo "Sample data" > "$filename"
fi

PowerShell:

$filename = "data.txt"

if (Test-Path $filename) {
    Write-Host "File exists! Reading..."
    Get-Content $filename
}
else {
    Write-Host "File not found! Creating..."
    "Sample data" | Out-File $filename
}

Why this is powerful: Script adapts to what it finds! If the file exists, it reads it. If not, it creates it.

File tests (Bash):

  • -f = file exists
  • -d = directory exists
  • -r = file is readable
  • -w = file is writable
Practical

Real-World: Disk Space Monitor

Bash:

usage=$(df -h / | tail -1 | awk '{print $5}' | sed 's/%//')

if [ $usage -gt 90 ]; then
    echo "CRITICAL: Disk $usage% full!"
    echo "Alert sent on $(date)" >> disk_alerts.log
elif [ $usage -gt 75 ]; then
    echo "WARNING: Disk $usage% full"
elif [ $usage -gt 50 ]; then
    echo "OK: Disk $usage% used"
else
    echo "GOOD: Plenty of space ($usage%)"
fi

PowerShell:

$disk = Get-PSDrive C
$usage = [math]::Round(($disk.Used / ($disk.Used + $disk.Free)) * 100)

if ($usage -gt 90) {
    Write-Host "CRITICAL: Disk $usage% full!" -ForegroundColor Red
    "Alert sent on $(Get-Date)" | Out-File disk_alerts.log -Append
}
elseif ($usage -gt 75) {
    Write-Host "WARNING: Disk $usage% full" -ForegroundColor Yellow
}
elseif ($usage -gt 50) {
    Write-Host "OK: Disk $usage% used" -ForegroundColor Cyan
}
else {
    Write-Host "GOOD: Plenty of space ($usage%)" -ForegroundColor Green
}

Real-world use: Run this daily to monitor disk space and get alerts before you run out!

Decision Flow Visualization

Start
  ↓
Is condition 1 true?
  ├─ YES → Do action 1 → End
  └─ NO
      ↓
  Is condition 2 true?
      ├─ YES → Do action 2 → End
      └─ NO
          ↓
      Do default action → End

⚠️ Common Confusion: = vs -eq

Single = is for assignment (storing):

  • age=25 → Put 25 into age

-eq is for comparison (checking):

  • if [ $age -eq 25 ] → Check if age equals 25

Why the difference? It prevents accidental overwrites! If you could use = for both, you might accidentally change values when you meant to check them.

Memory trick:

  • = → “Make it equal” (assignment)
  • -eq → “Is it equal?” (comparison)

🎯 Try It Now: Build a Password Checker

Challenge: Create a script that checks if a password is strong enough!

For Bash:

echo "Password Strength Checker"
read -sp "Enter password: " password
echo ""

length=${#password}

if [ $length -ge 12 ]; then
    echo "✓ Strong password!"
elif [ $length -ge 8 ]; then
    echo "⚠ Medium password"
else
    echo "✗ Weak password! Use at least 8 characters"
fi

For PowerShell:

Write-Host "Password Strength Checker" -ForegroundColor Cyan
$password = Read-Host "Enter password" -AsSecureString
$plainPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto(
    [Runtime.InteropServices.Marshal]::SecureStringToBSTR($password))
$length = $plainPassword.Length

if ($length -ge 12) {
    Write-Host "✓ Strong password!" -ForegroundColor Green
}
elseif ($length -ge 8) {
    Write-Host "⚠ Medium password" -ForegroundColor Yellow
}
else {
    Write-Host "✗ Weak password! Use at least 8 characters" -ForegroundColor Red
}

Try it: Test with different password lengths!

Bonus Challenges:

  1. Add a check for maximum length (e.g., >20 = too long)
  2. Change the threshold values to make it stricter
  3. Add a congratulations message for strong passwords
Checkpoint #5 (90 minutes total)

What you’ve learned:

  • If-statements let scripts make decisions
  • Structure: if → check condition → do something
  • Multiple conditions: if, else if, else
  • Comparison operators: -eq, -gt, -lt, etc.
  • You built a password strength checker!

🎉 Almost there! You’re learning how to make smart scripts. One more big concept!

6. Loops: Doing Things Repeatedly

The Power of Repetition

This is where scripting really shines! Loops let you do the same thing over and over without copy-pasting code.

🏃 The Marathon Analogy

Imagine you need to:

  • Run around a track 10 times
  • Count each lap
  • Shout “Lap X completed!” after each one

You wouldn’t write:

Run lap 1, shout “Lap 1!”
Run lap 2, shout “Lap 2!”
Run lap 3, shout “Lap 3!”…(yikes!)

Instead, you’d say: “For each lap from 1 to 10, run and shout the number”

That’s exactly what a loop does—one instruction that repeats automatically!

Your First Loop: The For Loop

Simple

Bash: Count to 5

for i in 1 2 3 4 5; do
    echo "Number: $i"
done

Output:

Number: 1
Number: 2
Number: 3
Number: 4
Number: 5

Breaking it down:

  • for i in = for each item
  • 1 2 3 4 5 = the list of items
  • do = start of repeated action
  • done = end of repeated action
Simple

PowerShell: Count to 5

foreach ($i in 1..5) {
    Write-Host "Number: $i"
}

Output: Same as Bash!

Breaking it down:

  • foreach = for each item
  • $i in 1..5 = variable in range 1 to 5
  • { } = curly braces contain repeated code

Cool PowerShell trick: 1..5 automatically creates the range!

Looping Through Files

One of the most common uses: doing something to every file in a folder!

Medium

List All .txt Files

Bash:

for file in *.txt; do
    echo "Found: $file"
    echo "Size: $(wc -l < "$file") lines"
done

PowerShell:

foreach ($file in Get-ChildItem *.txt) {
    Write-Host "Found: $($file.Name)"
    $lines = (Get-Content $file).Count
    Write-Host "Size: $lines lines"
}

What's happening:

  • *.txt = matches all files ending in .txt
  • Loop processes each file one at a time
  • Could rename, copy, or modify each file!
Medium

Rename Multiple Files

Bash:

counter=1
for file in *.jpg; do
    newname="photo_$counter.jpg"
    mv "$file" "$newname"
    echo "Renamed $file to $newname"
    ((counter++))
done

PowerShell:

$counter = 1
foreach ($file in Get-ChildItem *.jpg) {
    $newName = "photo_$counter.jpg"
    Rename-Item $file $newName
    Write-Host "Renamed $($file.Name) to $newName"
    $counter++
}

Result: IMG_1234.jpg → photo_1.jpg, IMG_5678.jpg → photo_2.jpg, etc.

Real-world use: Organize hundreds of downloaded photos instantly!

Practical

Backup Script with Logs

Bash:

echo "Starting backup at $(date)"
backup_dir="/backup/$(date +%Y%m%d)"
mkdir -p "$backup_dir"

for folder in Documents Pictures Videos; do
    echo "Backing up $folder..."
    cp -r ~/"$folder" "$backup_dir/"
    if [ $? -eq 0 ]; then
        echo "✓ $folder backed up successfully"
    else
        echo "✗ $folder backup failed!"
    fi
done

echo "Backup completed at $(date)"

PowerShell:

Write-Host "Starting backup at $(Get-Date)"
$backupDir = "C:\Backup\$(Get-Date -Format 'yyyyMMdd')"
New-Item -ItemType Directory -Path $backupDir -Force | Out-Null

foreach ($folder in @("Documents", "Pictures", "Videos")) {
    Write-Host "Backing up $folder..." -ForegroundColor Cyan
    $source = "$env:USERPROFILE\$folder"
    Copy-Item $source $backupDir -Recurse -ErrorAction SilentlyContinue
    if ($?) {
        Write-Host "✓ $folder backed up successfully" -ForegroundColor Green
    }
    else {
        Write-Host "✗ $folder backup failed!" -ForegroundColor Red
    }
}

Write-Host "Backup completed at $(Get-Date)" -ForegroundColor Green

Why this is amazing: One script backs up multiple folders, creates dated backups, and logs success/failure!

The While Loop: Loop Until a Condition

While loops run as long as something is true. Great for waiting or monitoring!

Simple

Countdown Timer

Bash:

counter=5
while [ $counter -gt 0 ]; do
    echo "$counter seconds remaining..."
    sleep 1
    ((counter--))
done
echo "Time's up!"

PowerShell:

$counter = 5
while ($counter -gt 0) {
    Write-Host "$counter seconds remaining..."
    Start-Sleep -Seconds 1
    $counter--
}
Write-Host "Time's up!" -ForegroundColor Red

What happens: Counts down from 5 to 1, waiting 1 second between each number!

Loop Flow Visualization

FOR LOOP:
┌─────────────────────┐
│ Start               │
└──────┬──────────────┘
       ↓
┌──────────────────────┐
│ Get next item        │ ←─┐
└──────┬───────────────┘   │
       ↓                    │
┌──────────────────────┐   │
│ Do action with item  │   │
└──────┬───────────────┘   │
       ↓                    │
   More items? ─────────────┘
       │ No
       ↓
   End

WHILE LOOP:
┌─────────────────────┐
│ Check condition     │ ←─┐
└──────┬──────────────┘   │
       ↓                   │
   True?                   │
       ↓ Yes               │
┌──────────────────────┐  │
│ Do action            │  │
└──────┬───────────────┘  │
       │                   │
       └───────────────────┘
       ↓ No
   End

⚠️ Common Confusion: Infinite Loops

Be careful! If the condition never becomes false, the loop runs forever!

Dangerous example:

# DON'T DO THIS!
counter=5
while [ $counter -gt 0 ]; do
    echo "Running..."
    # Oops! Forgot to decrease counter
done

This loops forever because counter stays 5!

How to fix: Always make sure something changes that will eventually make the condition false

How to stop a runaway loop: Press Ctrl+C

🎯 Try It Now: Build a File Organizer

Challenge: Create a script that organizes files by extension!

Setup first (create test files):

Bash:

touch test1.txt test2.txt photo1.jpg photo2.jpg doc1.pdf

PowerShell:

New-Item test1.txt, test2.txt, photo1.jpg, photo2.jpg, doc1.pdf -ItemType File

Then run the organizer:

Bash:

for file in *; do
    if [ -f "$file" ]; then
        ext="${file##*.}"
        mkdir -p "$ext"_files
        mv "$file" "$ext"_files/
        echo "Moved $file to $ext"_files/"
    fi
done

PowerShell:

foreach ($file in Get-ChildItem -File) {
    $ext = $file.Extension.TrimStart('.')
    $folder = "$ext" + "_files"
    New-Item -ItemType Directory -Path $folder -Force | Out-Null
    Move-Item $file $folder
    Write-Host "Moved $($file.Name) to $folder"
}

Result:

  • txt_files/ (contains test1.txt, test2.txt)
  • jpg_files/ (contains photo1.jpg, photo2.jpg)
  • pdf_files/ (contains doc1.pdf)

Success! Files automatically organized by type!

Checkpoint #6 (115 minutes total)

What you've learned:

  • Loops repeat actions automatically
  • For loops: process items in a list
  • While loops: repeat while condition is true
  • Loop through files with wildcards (* pattern)
  • You built a file organizer!

🎉 Amazing progress! One final section to tie it all together!

7. Your First Complete Script

Bringing It All Together

You've learned all the pieces! Now let's combine them into a real, useful script that you might actually use.

🍰 The Recipe Book Analogy

You've learned:

  • Commands (ingredients)
  • Variables (prep bowls)
  • Input/Output (serving)
  • If-statements (adjusting for taste)
  • Loops (repeating steps)

Now we're combining them into a complete recipe—a full script that does something impressive!

Project: System Health Checker

Let's build a script that checks your computer's health and gives you a report!

Complete Bash Script

system_health.sh

#!/bin/bash
# System Health Checker
# Checks disk space, memory, and CPU

echo "================================"
echo "   SYSTEM HEALTH REPORT"
echo "   Generated: $(date)"
echo "================================"
echo ""

# Get hostname
hostname=$(hostname)
echo "Computer: $hostname"
echo ""

# Check Disk Space
echo "--- DISK SPACE ---"
disk_usage=$(df -h / | tail -1 | awk '{print $5}' | sed 's/%//')

if [ $disk_usage -gt 90 ]; then
    echo "❌ CRITICAL: Disk $disk_usage% full"
    status="CRITICAL"
elif [ $disk_usage -gt 75 ]; then
    echo "⚠️  WARNING: Disk $disk_usage% full"
    status="WARNING"
else
    echo "✅ OK: Disk $disk_usage% used"
    status="GOOD"
fi
echo ""

# Check Memory
echo "--- MEMORY ---"
if command -v free &> /dev/null; then
    mem_usage=$(free | grep Mem | awk '{print int($3/$2 * 100)}')
    echo "Memory usage: $mem_usage%"
    
    if [ $mem_usage -gt 90 ]; then
        echo "❌ HIGH: Memory almost full"
        status="CRITICAL"
    elif [ $mem_usage -gt 75 ]; then
        echo "⚠️  MEDIUM: Monitor memory"
    else
        echo "✅ OK: Memory healthy"
    fi
fi
echo ""

# Check recent files
echo "--- RECENT CHANGES ---"
echo "Last 5 modified files in home directory:"
counter=1
for file in $(ls -t ~ | head -5); do
    echo "  $counter. $file"
    ((counter++))
done
echo ""

# Save report
report_file="health_report_$(date +%Y%m%d).txt"
{
    echo "System Health Report"
    echo "Date: $(date)"
    echo "Overall Status: $status"
    echo "Disk Usage: $disk_usage%"
    echo "Memory Usage: $mem_usage%"
} > "$report_file"

echo "================================"
echo "Report saved to: $report_file"
echo "================================"
Complete PowerShell Script

SystemHealth.ps1

# System Health Checker
# Checks disk space, memory, and processes

Write-Host "================================" -ForegroundColor Cyan
Write-Host "   SYSTEM HEALTH REPORT" -ForegroundColor Cyan
Write-Host "   Generated: $(Get-Date)" -ForegroundColor Cyan
Write-Host "================================" -ForegroundColor Cyan
Write-Host ""

# Get computer name
$computerName = $env:COMPUTERNAME
Write-Host "Computer: $computerName"
Write-Host ""

# Check Disk Space
Write-Host "--- DISK SPACE ---" -ForegroundColor Yellow
$disk = Get-PSDrive C
$diskUsage = [math]::Round(($disk.Used / ($disk.Used + $disk.Free)) * 100)

if ($diskUsage -gt 90) {
    Write-Host "❌ CRITICAL: Disk $diskUsage% full" -ForegroundColor Red
    $status = "CRITICAL"
}
elseif ($diskUsage -gt 75) {
    Write-Host "⚠️  WARNING: Disk $diskUsage% full" -ForegroundColor Yellow
    $status = "WARNING"
}
else {
    Write-Host "✅ OK: Disk $diskUsage% used" -ForegroundColor Green
    $status = "GOOD"
}
Write-Host ""

# Check Memory
Write-Host "--- MEMORY ---" -ForegroundColor Yellow
$os = Get-CimInstance Win32_OperatingSystem
$memUsage = [math]::Round((($os.TotalVisibleMemorySize - $os.FreePhysicalMemory) / $os.TotalVisibleMemorySize) * 100)
Write-Host "Memory usage: $memUsage%"

if ($memUsage -gt 90) {
    Write-Host "❌ HIGH: Memory almost full" -ForegroundColor Red
    $status = "CRITICAL"
}
elseif ($memUsage -gt 75) {
    Write-Host "
			

5 Free Labs to Practice Cloud Tools

🧪 5 Free Labs to Practice Cloud Tools

Master Cloud, DevOps, and Containers with these hands-on, browser-based playgrounds — no install, no stress.

1. ✅ Katacoda (by O’Reilly)

  • Tools: Docker, Kubernetes, VMs, DevOps
  • Highlights: Interactive terminal, guided labs, real CLI access
  • Link: https://katacoda.com

2. ✅ Play with Docker

  • Tools: Docker, Swarm
  • Highlights: Free 4-hour sessions, real Docker instance, create & test containers
  • Link: labs.play-with-docker.com

3. ✅ Play with Kubernetes

  • Tools: Kubernetes (kubectl, YAML, Helm)
  • Highlights: 4-hour cluster lab, deploy pods/services without installing anything
  • Link: labs.play-with-k8s.com

4. ✅ GitHub Codespaces

  • Tools: Linux VM, Docker, DevContainers
  • Highlights: Free VM per repo, use Docker inside browser, ideal for project-based learning
  • Link: github.com/features/codespaces

5. ✅ Google Cloud Shell

  • Tools: gcloud CLI, Docker, Kubernetes, container registry
  • Highlights: Free Linux VM in browser, 5GB persistent disk, runs on GCP
  • Link: shell.cloud.google.com

💡 Bonus Labs for Cloud Practice

  • KodeKloud – Interactive DevOps playgrounds (Docker, K8s, Ansible)
  • Instruqt – Labs for Terraform, containers, CI/CD
  • KubeAcademy – Kubernetes fundamentals by VMware

⚠️ No installation needed for any of these labs. Just open and start typing commands. Perfect for laptops, tablets, and Chromebooks!