Linux Tips I Wish I Knew Long Ago – System bell for notification on long running tasks

Sometimes when running long running tasks (like a copy, move, or even a benchmark on a system) I want to know when the task is complete, so I can kick off the next task or see the results. Turns out there’s two simple commands (well, one command and one special char to be exact) to notify the user using the system bell:

tput bel

or

echo -e "\a"

So you could have a long running script (put this in a something.sh bash script and execute), like:

tar -czvf mybigtarfile bigdirectory
tput bel

Or you can do it right on the command line with the “;” to separate the tasks, such as:

$ mv bigfile /storage; tput bel 

On a mac the terminal icon will do the bounce up and down dance to get your attention.

In Windows if you’re using something like Putty, you need to set the default behavior to have the task bar flash. You then have to save this to the “Default Session” in the Saved Sessions Window.
2013-09-17_11-15-58

Leave a Reply

Your email address will not be published. Required fields are marked *