Shell Scripting / Bash Tricks
Stop watching your screen for a job to finish
đź§© The Challenge
You’ve just kicked off a massive log rotation or a database dump that takes ten minutes, and you end up staring at a blinking cursor because you’re terrified of missing the moment it finishes. It’s a waste of time, but we all do it so we can jump right back into the next task.
đź’ˇ The Fix
Use the terminal’s built-in ability to trigger a desktop notification or sound once your command hits the finish line. You’ll actually be able to get a coffee or check another server without worrying about downtime.
./long-running-script.sh && notify-send "Task finished" "Your script is done, go check it" || notify-send "Task failed" "Check the logs, something broke"
⚙️ Why It Works
By chaining your command with the logical AND (&&) or OR (||) operators, you’re telling the shell to fire off a desktop alert based on the exit code of your process. It effectively turns your terminal into a pager that actually alerts you when work is done.
🚀 Pro-Tip: Toss an alias into your .bashrc for “notify” and you can just slap it at the end of any long job like a post-script.
Linux Tips & Tricks | © ngelinux.com | 11/27/2026
