Stop waiting for a command to finish in the dark

Shell Scripting / Bash Tricks

Stop waiting for a command to finish in the dark

🧩 The Challenge

You trigger a massive database migration or a local tarball backup that takes forever, but then you get distracted by a ticket and forget if it actually finished or if it crashed. It’s annoying as hell to keep hitting enter just to check if the prompt is back.

💡 The Fix

Just tack on a notification at the end of your command so your desktop or phone chirps when the heavy lifting is done. You don’t have to keep staring at the terminal like a hawk.

your_long_running_command_here && notify-send "Task finished" "The job you were waiting on is finally done"

⚙️ Why It Works

Using the double ampersand acts as a gatekeeper, only executing the notification command if the first part finishes with a zero exit status. Most Linux desktops listen for that notify-send signal and pop a banner up instantly.

🚀 Pro-Tip: If you’re stuck on a remote server, use ‘ssh -Q’ or just have it play a terminal bell with ‘echo -e “\a”‘ instead of a desktop notification.

Linux Tips & Tricks | © ngelinux.com | 11/10/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted