Trigger Any Terminal Command With a Keyboard Shortcut Using Automator
If you tend to run the same Terminal command pretty often, then it makes sense to do one of two things: create a text expander snippet or turn it into a keyboard shortcut. How-To Geek shows you how to do the latter using Apple's built-in Automator tool.
All you'll need to do is create a new Automator action using the Run Shell Script command, type in your Terminal command, then add a shortcut in the System Preferences pane. The process is pretty simple, so head over to How-To Geek for the full guide.