Skip to content

Instantly share code, notes, and snippets.

View MRThugh's full-sized avatar
🏠
Working from home

Ali Kamrani MRThugh

🏠
Working from home
View GitHub Profile
@MRThugh
MRThugh / safe-backup.sh
Created February 22, 2026 16:53
Quick & safe file backup script: Automatically creates a dated backup copy before you edit any file. Zero risk, perfect for config files, scripts, and .env changes.
#!/usr/bin/env bash
# safe-backup.sh
# by MR.Thugh → github.com/MRThugh
#
# Quick & safe way: backup a file before you edit it
if [ $# -eq 0 ]; then
echo "Usage: ./safe-backup.sh filename"
echo " or: safe-backup.sh important.conf"
exit 1