Skip to content

How To Blog

  • TeamSpeak vs Discord: Which Is The Better in 2021?
  • The 5 Best Browser Tools To Protect Your Online Privacy Tools Review
  • Accessing Local Files and Folders on Remote Desktop Session Networking
  • How to Remove Audio From Video On Any Device How-To
  • Best construction calculator 2020 silver
  • 4 Free VPNs That Work With Netflix (2018) How-To
  • Best ti-83 calculator 2020

    Best ti-83 calculator 2020

  • online electricity bill check via mepco bill calculator Calculator

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

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

  • Switching From Windows To macOS: What You Need To Know Tutorials
  • how to download all photos from icloud to windows pc Tutorials
  • How To Split The Screen on a Mac Tutorials
  • How to open a folder from terminal mac Tutorials
  • How to Clear Browser Cache on iPhone and iPad iPad
  • How to Fix Your Disabled Account in the App Store and iTunes iPad

Leave a Reply Cancel reply

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

Archives

  • 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
  • July 2021
  • March 2021
  • November 2020
  • 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

  • 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
  • Linux
  • Linux Tips
  • 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
  • Wordpress

Recent Posts

  • What Is Taskeng.exe and Is It Safe?
  • What is Facebook Watch and how do I use it in 2020?
  • How to add Google Forms to your site
  • What is a custom domain and how to set it up
  • How to Record Skype Calls on iPhone, Android, Windows and Mac

Recent Comments

  1. How to Minimize a Windows Program to the System Tray 2023 - How To Blog on How to Fix System Tray or Icons Missing in Windows 10
  2. How can I unlock my Macbook using Apple Watch - How To Blog on How to Install Chrome OS on Macbook or iMac
  3. 4k hdmi switch with optical out - How To Blog on Is A Gaming PC Really More Expensive Than A Console?
  4. online video maker with music and pictures 2023 - How To Blog on 6 Video Editing Tips For Beginners
  5. 5 New Ways to Clean Electronics Safely - How To Blog on How to Clean Your Computer Properly, Inside and Out
  • How To Send Large Videos Computer Tips
  • The Best Apple Watch Faces for Health and Fitness 2022 Apple Watch
  • What Does HMU Mean (And How to Use It) How-To
  • How to Find Hidden Apps on iPhone 2021 iPhone
  • How to Add Network Folders to the Windows Search Index Windows 10
  • When Was The Internet Invented? 10 Facts You Probably Didn’t Know technology
  • WWDC 2020 – How to Add Face Mask to Memoji in iOS 14 How-To
  • How to Fix Choppy Videos on YouTube – 2022 Computer Tips

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version