How to add simple bell command to bash

Often when running commands in Linux terminal I had to multitask and switch to another terminal.

That is good, but how to get notification that first task is completed?

We all get bell notification from the terminal.
So why not use it?

In Linux there is a tool called beep, but it is not by default in many distributions.

For the simple notification I found not as elegant, but simple solution.
If you send ASCII BEL (\007) to terminal it will beep.

So to “create” bell command just add to .bashrc

alias bell="echo -ne '\007'"

and reload it

source ~/.bashrc

Then you can use bell command to produce bell sound.
For example:

find / -name test.txt&&bell

If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.

Leave a Reply

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