Press Command-Tab to see all your open applications, or Command-Shift-Tab to cycle through the open applications on your Mac. Bonus tip: If you want to move between different windows of a. From MacBook All-in-One For Dummies, 2nd Edition. MacBook owners have a number of tools that come in very handy for using their laptops efficiently and for maintaining the operating system to keep it running in top shape. These MacBook keyboard shortcuts for the Finder, a maintenance checklist, and a “translation” of the modifier keys will speed you on your way to.
With the built-in Terminal app on your Mac, you can run a number of commands to execute various actions on your machine. From taking screenshots of your screens to renaming a whole bunch of files at once, Terminal commands cover a lot of things that you usually do on your machines.
The only thing that you may not find to be inconvenient is having to launch the Terminal app each time you want to run a command. What if there was a better and quicker way to run Terminal commands on a Mac?
Well, there is actually. In fact, there are multiple ways to run a Terminal command using a keyboard shortcut on Mac. You can assign your favorite key combination to your specific command, and pressing the combination will execute that command on your machine.
Use An App To Run Commands Using a Shortcut On Mac
The most easiest way to assign keyboard shortcuts to your commands is to use a third-party app called iCanHazShortcut. This app makes it a whole lot easier to assign any keyboard shortcut to literally any command on your Mac.
To configure the app, all you need to know is the keyboard shortcut you want to assign and the command that is to be executed.
Download the free and open-source app on your Mac and move it to the Applications folder. Launch the app once it’s installed.
When the app interface loads-up, you’ll be in the Shortcuts tab by default. On this screen, find the button with a + (plus) sign in it at the bottom and click on it to add a new shortcut.
The following screen lets you configure the shortcut as well as the command it needs to execute. Here’s what you need to enter in each of the fields on the screen.
Shortcut – put your cursor in this field and type in the shortcut you want to assign to the command.
Action – it’s an optional name you can assign to later find the shortcut in the list.
Command – enter the exact command you want to be executed here.
Workdir – if your command requires a specific directory as the work directory, select it here.
You can do a test run by clicking on the play icon at the bottom. Once you’re satisfied, click on the icon next to it and it’ll save the shortcut.
The Preferences tab in the app also has a few options you can customize. This should give you more control as to how the app works on your Mac.
From now on, whenever you press the specified keyboard shortcut, it’ll run your Terminal command.
If there are more than one commands to be executed, you can add those to the app as well. Shortcuts can be modified and even deleted as well if you’d like to do it.
Execute Commands With a Shortcut Using Automator
Automator also allows you to run your commands using a keyboard shortcut. First you need to create a service containing your command and then assign the service a keyboard shortcut.
Launch the Automator app on your Mac. When the new document screen appears, click on Service and select Choose.
On the following screen, search for the action named Run Shell Script in the actions list. When you find it, drag it over to the main pane on the right-hand side.
You’ll see a large white box beneath the newly added action. Enter in all the commands you want to execute in this box. Think of this box as a Terminal window where you type your commands.
When you’ve entered your commands, click on the File menu at the top and select Save to save your service. Enter a meaningful name for the service and hit Save.
Now that the service is created, it’s time to assign it a keyboard shortcut. To do so, click on the Apple logo at the top-left corner and select System Preferences. Choose Keyboard on the following screen.
Head to the Shortcuts tab and then select Services from the list on the left. Then find your service in the right-hand side list, click on it, and press the desired keyboard shortcut.
Your service will be assigned your chosen keyboard shortcut.
When you press this shortcut, it’ll run the service which in turn will execute your Terminal command on your Mac.
Use ActionShortcuts To Run Commands Using a Shortcut
ActionShortcuts lets you run more things than just traditional Terminal commands. It lets you run Apple scripts, workflows, services, and of course, the Terminal commands.
Unlike other methods, this app isn’t free and costs $2.99. You can use the 7 day trial period though if you want to try it out first.
The following shows how to run a Terminal command with a keyboard shortcut using this app.
Launch the TextEdit app on your Mac. Click on the Format menu and select Make Plain Text to remove formatting.
Enter all the Terminal commands you wish to execute in the file. Then save the file by clicking on the File menu and selecting Save.
In the Save As dialog box, enter any name for the file but make sure the extension is command. Hit Save to save the file.
Download, install, and open the ActionShortcuts app on your Mac. Click on the Open Scripts Folder button on the main interface.
When the folder opens, drag and drop your command file onto it. Get back to the app and you’ll see your file in the list. Click on the Record Shortcut button next to your file to assign a keyboard shortcut.
Once a shortcut is assigned, pressing the shortcut will launch the .command file containing your commands on your Mac.
If you’d like to add additional files for execution, you can do so by clicking on the app icon in your menu bar and selecting Open Scripts Folder. All the commands that are to be executed must be placed in this folder and the app will recognize them.
Finder Navigation
General
New Finder window: Command N
Up one folder level: Command Up Arrow
Open selected folder: Command Down Arrow
Back: Command left bracket
Forward: Command right bracket
Direct Folder Access
Open the Applications folder: Command Shift A
Open the Computer folder: Command Shift C
Open desktop folder: Command Shift D
Go to Folder: Command Shift G
Open the Home folder of the currently logged-in user account: Command Shift H
Editing Commands
Select all (e.g. all text, or all items in the front Finder window): Command A
Copy selected item/text: Command C
Paste: Command V
Cut: Command X
Undo: Command Z
Redo: Command Shift Z
Move to Trash: Command Delete (or Command Backspace)
Miscellaneous
Move focus to the menu bar: Control-F2, or Control-Function-2 if you're using a Mac with a Touch Bar
Move focus to the Dock: Control F 3, or Control Function 3 if you're using a Mac with a Touch Bar
Move forward to the next most recently used application in a list of open applications: Command Tab
Minimize window: Command M
View as List: Command 2
Open selected item: Command O
Open Mac Help or current application help: Command question mark
Spotlight: Command Spacebar
Find any matching Spotlight attribute: Command F
Closing and Quitting
Close window: Command W
Eject: Command E
Force Quit (Equivalent of Ctrl-Alt-Delete): Command Option Esc
Force Quit front-most application: Command Shift Option Esc
Application and other MacOS keyboard commands
Note: Some applications may not support all of the below application key combinations.
File Commands
New document: Command N
Open document: Command O
Save the active document: Command S
Duplicate the active document: Command Shift S
Print dialog: Command P
Display a dialog for specifying printing parameters (Page Setup): Command Shift P
Quit application: Command Q
Shortcuts App Mac Os
Cursor Movement
End of the current line: Command Right Arrow
Beginning of the current line: Command Left Arrow
Beginning of the document: Command Up Arrow
End of the document: Command Down Arrow
End of the current word: Option right arrow
Beginning of the current word: Option Left Arrow
End of the current paragraph: Option Down Arrow
Beginning of the current paragraph: Option Up Arrow
Pressing Shift with these shortcuts selects the text between where the cursor starts and ends.
Mac Command Shortcuts List
Font Formatting
Decrease the size of the selected item: Command dash
Increase the size of the selected item: Command Shift equals
Boldface the selected text or toggle boldfaced text on and off: Command B
Underline the selected text or turn underlining on or off: Command U
Italicize the selected text or toggle italic text on or off: Command I
Display the Fonts window: Command T
Alignment
Left-align a selection: Command left brace
Right-align a selection: Command right brace
Center-align a selection: Command Shift backslash
Miscellaneous
Create A Shortcut On Mac
Display the Spelling window: Command Shift semicolon
Open a Find window: Command F
Open an application's preferences window (if it supports this keyboard shortcut): Command comma
Shortcuts For Mac Keyboard
For a more comprehensive listing of shortcuts check out this Apple Support article.