DEV Community

v. Splicer
v. Splicer

Posted on

20 Practical Bash Scripts for Everyday Automation (2026 Edition)

There is a particular moment most technical people recognize.

It happens late at night. You are halfway through some tedious digital ritual. Maybe renaming files. Maybe checking logs. Maybe copying the same directories to three different machines for the tenth time this week.

The keyboard feels mechanical. Your brain starts whispering something obvious.

Why am I still doing this manually?

Bash has been around longer than most modern programming languages, and yet in 2026 it remains one of the most brutally effective automation tools available. Not glamorous. Not fashionable. But devastatingly efficient. A good Bash script can erase hours of repetitive work every week.

The people who quietly dominate infrastructure, DevOps, security research, and systems engineering tend to have a folder somewhere filled with small scripts like these. Not massive frameworks. Not enterprise tooling. Just little blades they forged themselves.

This article walks through twenty practical Bash scripts that solve everyday problems. They are simple enough to understand yet powerful enough to save serious time.

No fluff. Just tools.

1. Automatic System Update Script

If you maintain Linux machines, updates become routine maintenance. Automating them prevents neglected systems.

#!/bin/bash
echo "Updating package lists…"
sudo apt update
echo "Upgrading packages…"
sudo apt upgrade -y
echo "Removing unnecessary packages…"
sudo apt autoremove -y
echo "System update completed at $(date)"

You can run this manually or schedule it with cron.

Example cron entry:

0 3 * * * /home/user/scripts/update.sh

Now your system updates itself every night at 3 AM.

2. Bulk File Renamer

Anyone who works with downloaded datasets, photos, or scraped content eventually needs to rename hundreds of files.

#!/bin/bash
count=1
for file in *.jpg; do
. mv "$file" "image_$count.jpg"
. ((count++))
done

You can easily modify this for other formats or naming patterns.

3. Disk Usage Analyzer

When storage mysteriously disappears, this script quickly identifies large directories.

#!/bin/bash
echo "Top 10 Largest Directories:"
du -h - max-depth=1 | sort -hr | head -10

Run it inside any directory and immediately see where space is being consumed.

4. Automatic Backup Script

Backups should never rely on memory.

#!/bin/bash
SOURCE="/home/user/projects"
DEST="/mnt/backup/projects"
rsync -av - delete "$SOURCE" "$DEST"
echo "Backup completed at $(date)"

This uses rsync, which is efficient and only transfers changed files.

5. Website Uptime Monitor

A simple Bash script can check if a website is alive.

#!/bin/bash
URL="https://example.com"
status=$(curl -o /dev/null -s -w "%{http_code}" $URL)
if [ "$status" == "200" ]; then
. echo "Website is online"
else
. echo "Website appears down (Status: $status)"
fi

Add notifications or logging for production monitoring.

6. Log File Watcher

Security researchers and sysadmins constantly monitor logs.

#!/bin/bash
LOGFILE="/var/log/auth.log"
tail -f "$LOGFILE"

This streams login activity in real time.

Add grep filters to isolate failed login attempts

7. Git Auto Commit Script

If you maintain small personal projects or notes repositories, automation helps maintain commit history.

#!/bin/bash
cd /home/user/projects/myrepo
git add .
git commit -m "Automated commit $(date)"
git push

Run via cron for periodic snapshots.

8. Batch Image Converter

Convert entire directories of images using ImageMagick.

#!/bin/bash
for file in *.png; do
. convert "$file" "${file%.png}.jpg"
done

Useful for web asset pipelines.

9. Directory Organizer

Automatically sort files into folders by extension.

#!/bin/bash
for file in *; do
. if [ -f "$file" ]; then
. ext="${file##*.}"
. mkdir -p "$ext"
. mv "$file" "$ext/"
. fi
done

Your messy download directory instantly becomes structured.

10. Network Scanner

A lightweight Bash-based network scanner.

#!/bin/bash
network="192.168.1"
for ip in {1..254}; do
. ping -c 1 "$network.$ip" &> /dev/null && echo "$network.$ip is online"
done

Useful for quickly identifying active devices.

11. Quick Archive Script

Compress directories automatically.

#!/bin/bash
DIR=$1
tar -czvf "$DIR.tar.gz" "$DIR"
echo "Archive created: $DIR.tar.gz"

Usage:

./archive.sh myfolder

12. Weather From Terminal

Yes, Bash can fetch weather data.

#!/bin/bash
curl wttr.in

For a specific city:

curl wttr.in/NewYork

Surprisingly readable.

13. Random Password Generator

Security professionals often need quick credentials.

#!/bin/bash
openssl rand -base64 16

Produces a secure random password instantly.

14. Process Killer by Name

When runaway programs appear, this script cleans them quickly.

#!/bin/bash
PROCESS=$1
pkill "$PROCESS"
echo "$PROCESS processes terminated."

Usage:

./killproc.sh chrome

15. File Change Monitor

Detect when files are modified.

#!/bin/bash
WATCH_DIR="/home/user/projects"
inotifywait -m -r "$WATCH_DIR"

This is excellent for build pipelines or security monitoring.

16. Automatic Screenshot Tool

For documentation or testing workflows.

#!/bin/bash
import -window root screenshot_$(date +%F_%T).png

Requires ImageMagick.

17. CPU Temperature Monitor

Hardware monitoring is easy with Bash.

#!/bin/bash
watch -n 2 sensors

Updates CPU temperatures every two seconds.

18. Internet Speed Test

Quick network benchmarking.

#!/bin/bash
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -

Many engineers keep a script like this handy.

19. Project Bootstrap Script

Starting new projects often means creating the same directory structure.

#!/bin/bash
PROJECT=$1
mkdir -p "$PROJECT"/{src,docs,tests}
touch "$PROJECT/README.md"
echo "Project structure created for $PROJECT"

Usage:

./bootstrap.sh myapp

20. Daily Journal Logger

A surprisingly useful script.

#!/bin/bash
FILE="$HOME/journal_$(date +%F).txt"
echo "$(date): $1" >> "$FILE"

Usage:

./log.sh "Investigated strange network traffic today."

Over time you build a searchable engineering diary.

Why Bash Still Matters in 2026

There is an industry obsession with complexity.

New languages. New frameworks. Entire ecosystems built to solve problems that a twenty line shell script could have handled quietly.

Bash endures because it operates at the layer where real work happens. Files. Processes. Networks. System calls.

It sits between human intent and machine behavior.

Once you start writing small scripts like these, a pattern emerges. You stop performing repetitive digital labor. Instead you design systems that perform the labor for you.

That shift changes how you think about computers.

You stop being a user.

You start being an operator.

And somewhere on your machine, usually buried in a directory called something like ~/scripts, those little pieces of automation accumulate. One script handles backups. Another watches logs. Another organizes files. Another checks whether a server somewhere across the world is still breathing.

Individually, they look trivial.

Together- they quietly run half your digital life.

Most people never build that toolkit.

The ones who do rarely go back.

If you want some more tried and true examples of these, here are the scripts I run daily-

SCRIPTKIT: Bash Scripts for Recon, Automation & Daily Ops

Cold Signal Script Library- Ultimate Compendium of High-Level Scripts & Automations

Python Automation Secrets: 100 Scripts That Save 10 Hours Per Week

The Defensive Scripters Playbook: Scripts for Monitoring, Triage, and Forensics (high level)

Top comments (0)