How to play notification sound on the command line

The following bash script plays a notification bell on almost any Linux computer where common desktop components are installed:

paplay /usr/share/sounds/freedesktop/stereo/complete.oga

complete.oga comes from the sound-theme-freedesktop APT package on Ubuntu, whereas paplay is part of the pulseaudio-utils package. If you don’t have these packages installed, you can install them with:

sudo apt install sound-theme-freedesktop pulseaudio-utils