Home >Common Problem >Run new Terminal commands directly from the Dock on your Mac

Run new Terminal commands directly from the Dock on your Mac

PHPz
PHPzforward
2023-04-13 14:52:06748browse

Need to run a terminal command as soon as possible? You can do this right from the Dock with this neat trick for Mac.

You must have the Terminal app open and running in the Mac Dock for this trick to work. The rest is super easy:

    1. Find the Terminal icon in the Dock on your Mac and right-click (or control-click) the Terminal Dock icon
    2. Select "New Command" in the pop-up menu option

Run new Terminal commands directly from the Dock on your Mac

    1. ##In the "New Command" window Enter the command to run in

Run new Terminal commands directly from the Dock on your Mac

If you want the shell to persist after the command completes, check Run command in shell ” checkbox, otherwise by default, only the command will run, and when it completes, the shell will not be available.

I personally like to use this trick with htop, but there is no shortage of commands that work both by default and through Homebrew.

The Terminal application must be running for these Dock menu options to be available. You'll see that the new terminal window and new remote connection also have handy shortcuts.

By the way, this trick exists in both modern and older versions of Mac OS X, so if you're running on a fairly old Mac, you can use it too.

The above is the detailed content of Run new Terminal commands directly from the Dock on your Mac. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yundongfang.com. If there is any infringement, please contact admin@php.cn delete