Skip to content

5000+ Great Articles

Best Articles & Essays: Interesting Articles to Read Online

  • How To Sync Outlook Contacts With Android, iPhone, Gmail & More iPhone
  • How to Convert Multiple Images to One PDF Document on PC How-To
  • Advanced Search on Twitter Like a Pro Computer Tips
  • The Best IFTTT Alternatives Tools Review
  • Best hp financial calculator 2020 black
  • The best TV antennas of 2022 Indoor and Outdoor Gadgets
  • Viewing and Inserting the Date a Document was Last Modified in a Word Document Office Tips
  • How to Factory Reset Your Samsung Galaxy Watch Smartphones

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

Posted on October 10, 2020 By blog_786 No Comments on How To Run a Terminal Command Using a Keyboard Shortcut On Mac

How To Run a Terminal Command Using a Keyboard Shortcut On Mac.

With the built-in Terminal application on your Mac, you can run a series of commands to perform various actions on your computer. Terminal commands cover a lot of things that you usually do on your machines, from taking screenshots to renaming an entire group of files at once.

The only thing that may not seem inconvenient to you is to launch the Terminal application every time you want to execute a command. What if there was a better and faster way to run terminal commands on Mac?

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

Well, it really is. In fact, there are several ways to launch a Terminal command using a keyboard shortcut on a Mac. You can assign your favorite keyboard shortcut to your specific command, and pressing that shortcut will execute that command on your computer.

Use an application to run commands with a shortcut on a Mac

The easiest way to assign keyboard shortcuts to your commands is to use a third party application called iCanHazShortcut. This app makes it much easier to assign any keyboard shortcut to literally any command on your Mac.

To customize an application, all you need to know is the keyboard shortcut you want to assign and the command you need to execute.

Download the free open source application to your Mac and move it to the Applications folder. After installation, launch the application.

–

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

When the application interface has loaded, you will by default be on the Shortcuts tab. On this screen, find the button with the + (plus) sign at the bottom and click on it to add a new shortcut.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

On the next screen, you can customize the shortcut as well as the command to be executed. Here’s what you need to enter in each of the fields on the screen.

Shortcut – Place your cursor in this field and enter the shortcut you want to assign to the command.
An action is an optional name that you can assign to later search for a shortcut in the list.
Command – Enter here the exact command you want to execute.
Workdir – If your team needs a specific directory as a working directory, select it here.

You can do a test run by clicking on the play icon below. If you’re happy with it, click on the icon next to it and the shortcut will be saved.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

The app’s Settings tab also has several options that you can tweak. This should give you more control over how the application works on your Mac.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

From now on, when you press the specified keyboard shortcut, it launches your Terminal command.

If more than one command needs to be executed, you can also add them to the application. Labels can be changed and even removed if you like.

Execute commands with a shortcut using Automator

Automator also lets you run your commands with a keyboard shortcut. First, you need to create a service containing your command and then assign a keyboard shortcut to the service.

Launch the Automator app on your Mac. When the new document screen appears, click Tools and select Select.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

On the next screen, find the action named “Run Shell Script” in the list of actions. When you find it, drag it to the main panel on the right side.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

You will see a large white box below the action you just added. Enter all the commands you want to execute in this field. Think of this field as a terminal window where you enter your commands.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

When you’ve entered your commands, click the File menu at the top and select Save to save the service. Enter a friendly name for the service and click Save.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

Now that the service has been created, it’s time to assign a keyboard shortcut to it. To do this, click the Apple logo in the upper left corner and select System Preferences. On the next screen select “Keyboard”.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

Go to the Shortcuts tab and select Services from the list on the left. Then find your service in the list on the right, click it and press the desired keyboard shortcut.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

Your service will be assigned the keyboard shortcut of your choice.

When you click this shortcut, it starts a service, which in turn executes your terminal command on your Mac.

Use ActionShortcuts to run commands with the shortcut

ActionShortcuts lets you run more things than just traditional terminal commands. It allows you to run Apple scripts, workflows, services, and of course, terminal commands.

Unlike other methods, this app is paid and costs $ 2.99. You can use a 7-day trial if you want to try it first.

Shown below is how to run a terminal command using a keyboard shortcut using this application.

Launch TextEdit app on your Mac. Open the Format menu and choose Make Plain Text to remove the formatting.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

Enter in the file all the Terminal commands that you want to execute. Then save the file by clicking the File menu and choosing Save.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

In the Save As dialog box, enter any file name, but make sure the extension is a command. Click “Save” to save the file.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

Download, install and open the ActionShortcuts app on your Mac. Click the Open Scripts Folder button in the main interface.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

When the folder opens, drag the batch file into it. Go back to the app and you will see your file listed. Click the Record Shortcut button next to the file to assign a keyboard shortcut.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

Once a shortcut is assigned, clicking on it will launch a .command file containing your commands on your Mac.

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

If you want to add additional files to run, you can do so by clicking the application icon in the menu bar and choosing Open Scripts Folder. All commands that need to be executed must be placed in this folder and the application will recognize them.

–

How To Run a Terminal Command Using a Keyboard Shortcut On Mac

Share this:

  • Twitter
  • Facebook
Tutorials Tags:Execute commands with a shortcut using Automator, How To Run a Terminal Command Using a Keyboard Shortcut On Mac, Use ActionShortcuts to run commands with the shortcut, Use an application to run commands with a shortcut on a Mac

Post navigation

Previous Post: How To Update Mac OS X & Mac Apps From Terminal
Next Post: The Best Mac Keyboard Shortcuts to Learn

Related Posts

  • How to Sign a PDF on Mac Tutorials
  • How to easy Format a Mac Drive or Partition with the APFS File System Tutorials
  • How to Mirror iPhone or Mac to Amazon Fire Stick iPhone
  • Quickly delete an image from iCloud Tutorials
  • How to Play Among Us on Your Mac Tutorials
  • How To Block Unauthorized App Store Purchases Under Your Account Tutorials

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • March 2021
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • AI Tools & Guides
  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Featured Posts
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • islamic Books
  • Linux
  • Linux Tips
  • Mac OS X
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Windows XP Tips
  • Wordpress
  • 4 Ways to Share WiFi Without Giving Away Your Password
  • How to Get 2 Free Audiobooks From Audible Trial Instead of 1
  • 10 Things to Check Before Publishing a YouTube Video
  • A Simple Trick to Get 50% Discount on Audible for Three Months
  • How to reset your SIM card
DMCA.com Protection Status

Recent Posts

  • 4 Ways to Share WiFi Without Giving Away Your Password
  • How to Get 2 Free Audiobooks From Audible Trial Instead of 1
  • 10 Things to Check Before Publishing a YouTube Video
  • MailTag: Real-time Email Tracking, Made Easy
  • Pokemon Sleep: what is it and how to play

Recent Comments

  1. This Simple Trick Lets You Play YouTube in the Background on iOS on YouTube Not Working? Here Are Quick Fixes To Try
  2. How to Bypass Chromecast DNS and Circumvent Geo Blocking on 5 Cool Websites to Find Good Movies and TV Shows on Netflix
  3. 5 Cool Websites to Find Good Movies and TV Shows on Netflix on check netflix video quality internet explorer
  4. SmartDNS vs VPN “What’s the Difference?” on How to Watch Apple TV on Roku
  5. How to go Back to the old YouTube Layout (2013) on 10 Things to Check Before Publishing a YouTube Video
  • Set Up Custom Reddit Alerts With “Notifier For Reddit” Cool Websites
  • Best Sites for Travel Deals 2022 Cool Websites
  • How to Boost your Laptop Speed in 5 Simple Steps How-To
  • How to Fix C14A Snapchat Error Smartphones
  • 4 Metronome Online & Mobile Apps & Why They’re Useful

    The metronome is a must-have tool for every person who is serious about It used to be thought that you would have to spend a lot of money on a m

  • How to Set a Custom Background as Chrome New Tab Page How-To
  • Attach a USB Device to a Virtual Machine in VMware How-To
  • How to Run PS2 Games on PC (Step by Step Guide) How-To

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version