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


echo -e "\a"

So you could have a long running script (put this in a 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.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.