I've downloaded the Handbrake CLI. What's the best place to install a command line app on my Mac?
2 Answers
/usr/local/bin
is meant for installing local (UNIX) software. Conveniently, it is also included in $PATH by default, so you don't need to prefix the full path to run commands installed there.
You do need root access to install/copy files there, you could accomplish this by using sudo
while moving the binary there.
The best way to install anything on OSX is (IMHO) with Homebrew. You can install Homebrew with this command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then you can install stuff (like handbrakeCLI
) like this:
brew install handbrake
Then you can run it straight away from any command prompt with:
handbrakeCLI ...
-
2This is out of date (17-03-2017):
brew install handbrake
will install the handbrakecli. After it installswhich handbrakecli
to confirm its existence.– SimonMar 16, 2017 at 23:43 -
Currently this installs on Yosemite as
HandBrakeCLI
-- important for those with a case-sensitive file system.– pcroninAug 12, 2017 at 20:37 -
315-02-2019 - could not find HandBrakeCLI/handbrakecli in brew, so I installed it via handbrake.fr/rotation.php?file=HandBrakeCLI-1.2.0.dmg– SimonFeb 14, 2019 at 22:31
-
brew install handbrake
works for me on Catalina. it downloadedhandbrake-1.3.0.catalina.bottle.1.tar.gz
– XoXoJan 5, 2020 at 23:54 -
brew cask install handbrake
is the command to install the HandBrake application, but as far as I can tell, it does not also install the command line application (used for scripting batch conversion, etc). That must be downloaded from the link that @Simon provided. Apr 6, 2020 at 4:38