Get Terminal To Tell You When It’s Done [OS X Tips]


Speak Terminal

Terminal has tons of great applications on the Mac. By accessing the Unix underpinnings of Mac OS X, Terminal allows power users and newbies alike to do things with their Mac that may not be enabled out of the box.

Code monkeys and script jockeys frequently use Terminal to run longer processes than typical, like compiling code (the process of making all those little lines of code into an app that will run on your Mac) or running scripts. When they finish, they finish. There’s no built in way to know that they’re done.

Luckily, there’s a neat little command that can be added to any other Terminal command that will have it speak out loud to you. While it makes little sense for a quick command, it could be pretty helpful when issuing commands that lead to longer processes.

To make this happen, simply add the command below to any other command task in terminal, at the end of the line.

&& say "text to say here"

For example, using our history Terminal command from a couple of weeks ago, you’d want to use something like this:

history | grep "defaults write" >> ~/Documents/defaultsLog.txt && say "all done, dude"

When the text document is created, Terminal says, “all done, dude,” notifying me that I can hop back into terminal and do anything else I need to do there. If the voice you have chosen in System Preferences isn’t to your liking, you can also use a flag on the Terminal command to change voices on the fly (you’ll have to have the voice on your system, though, to make it work). To have Kathy voice your alert, simply add the following -v flag to your command, like so:

&& say -v Kathy "all done, dude"

Fun to play with, for sure, and potentially helpful for anyone needing an audible notification that a specific task is finished in Terminal.

Source: @neils on Twitter Via: OS X Daily


Daily round-ups or a weekly refresher, straight from Cult of Mac to your inbox.

  • The Weekender

    The week's best Apple news, reviews and how-tos from Cult of Mac, every Saturday morning. Our readers say: "Thank you guys for always posting cool stuff" -- Vaughn Nevins. "Very informative" -- Kenly Xavier.