As a software engineer or developer, ever found yourself waiting for a heavy command to finish running in the terminal, wondering what to do with all that downtime?
One way to increase your productivity is by using waiting time effectively. Instead of staring passively at the terminal, you can set up a system to alert you when a command has finished. This way, you can use the wait time to do something else, whether it's finishing your coffee, reading an article, or working on other tasks.
Let's quickly roll into the terminal commands without wasting much time. Below, you will find some useful commands for Linux and Windows to get the expected results.
In Linux,
Using tput command:
$ tput bel
Using echo command:.
$ echo -e '\a'
$ echo -e '\007'
Using printf command:
$ printf '\a'
$ printf '\007
In Windows (Powershell),
Play default beep:
[console]::beep()
If you want to customize the frequency and duration of the sound by customizing the given command like this,
[console]::beep(frequency,duration)
where,
frequency: must be between 37 and 32767
duration: in milliseconds (e.g., 1000, 5000, 10000)
Play system sound:
[System.Media.SystemSounds]::Beep.Play()
Finishing Touch
Now, you are aware of how to make some noise through terminal. So, what are you waiting for? Just go and try it out in your day to day tasks related terminal and improve your productivity. If I missed something or if you know a more interesting command to alert when a command finished, leave it in the comments section. We're eager to try it out! This is the end of the post but it is the beginning to make yourself better.
If you want to support my work, you can buy me a coffee ☕.
Thank you for reading this post. Keep learning, keep growing! 🚀✨
