← HOME

Nine Bash Utility Scripts for Linux

Ben Santora — 2026-04-04

A collection of nine utility scripts written in Bash for Linux. They cover system monitoring, file organization, USB drive management, screen recording, and machine inventory. Each script is self-contained — no build step, no package manager, just Bash and standard Linux tools.

bash-scripts.tar.gz — 9 scripts

Requires: bash, and per-script deps listed below

Download

System Tools

system_dashboard_yad.sh

A YAD-based system health dashboard. Displays CPU usage, memory utilization, and key system stats in a GUI window that refreshes on a timer. Useful as a desktop widget or quick health check.

Requires: yad, top, free

network_monitor.sh

Real-time network speed monitor. Auto-detects the active interface from the routing table and passes it to vnstat --live, which refreshes every second showing current upload and download rates.

Requires: vnstat — install with sudo apt install vnstat

machines.sh

A lightweight machine inventory system backed by SQLite. Stores machine name, hardware configuration, OS, and notes in ~/machines.db. Creates and seeds the database on first run. Useful for tracking a fleet of physical or virtual machines.

Requires: sqlite3

find_large_files.sh

Scans a directory tree for files over 100MB and reports their sizes in human-readable format (KB, MB, GB). Useful for finding disk hogs before a cleanup or backup.

Requires: standard Linux utilities only

File Tools

sort_by_ext_recursive.sh

Walks a directory tree recursively and sorts every file into subdirectories named by extension — .pdf files go into pdf/, .jpg into jpg/, and so on — all collected inside a sorted_files/ folder at the root of the source directory. Takes a path argument or defaults to the current directory.

Requires: standard Linux utilities only

USB Tools

usb_safe_eject.sh

Takes a block device name as an argument (e.g., sdb or sdc1). Monitors /proc/diskstats and watches for I/O activity on the device. Once the drive has been idle for five consecutive seconds it reports safe to eject. Prevents data corruption from pulling a drive mid-write.

bash usb_safe_eject.sh sdb

Requires: standard Linux utilities only

ventoy-check.sh

Auto-detects a mounted Ventoy USB by its partition label. Lists the ISO files at the root of the drive, or reports the drive is empty if nothing is there. No arguments needed.

Requires: lsblk

ventoy-clean.sh

Clears all files from a mounted Ventoy USB while leaving the ventoy/ and EFI/ directories intact. Run it before loading a new set of ISOs onto the drive. Auto-detects the mount point by Ventoy's partition label.

Requires: lsblk

Screen Recording

screen-recorder_yad.sh

An X11 screen recorder built on FFmpeg and YAD. Detects your screen resolution automatically via xdpyinfo and saves recordings to ~/Videos/ScreenRecordings/. A YAD dialog controls start and stop — no command line interaction needed once launched.

Requires: ffmpeg, yad, xdpyinfo — X11 only, not Wayland


Written by Ben Santora — bensantora.com