Tip 71Notify from the Command Line

There’s no official way of making a notification pop-up appear from the command line. This would be useful to send a message that a certain command has completed, for example. The good news is that you can use a Ruby gem called terminal-notifier to do so (gems are extensions to the Ruby programming language that’s included with OS X).

To install terminal-notifier, open a Terminal window in the usual way, and type the following:

 
sudo gem install terminal-notifier

Type your password when prompted. Installation should take seconds.

Using terminal-notifier is easy. Just use the -message command option to specify the message, which should appear within quotation marks (or be escaped in the usual way), and use ...

Get Mac Kung Fu, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.