Using Homebrew

The brew command performs all Homebrew operations: searching for software, installing it, updating it, uninstalling it, and more. Let’s demonstrate its use by installing a package.[31] Suppose you want a command to work with MP3 files, displaying and modifying the artist and title information inside them, known as ID3 tags. We use Homebrew to search for any packages with “id3” in their names:

brew search id3
id3lib     id3tool    id3v2      libid3tag

After some web research, you determine that id3tool is the program you want. To install it, run the brew install command:

brew install id3tool
==> Downloading http://nekohako.xware.cx/id3tool/...
##########################################################
==> ./configure --disable-debug --prefix=/usr/local/...
==> make install
/usr/local/Cellar/id3tool/1.2a: 6 files, 40K,
built in 2 seconds

That’s it! The id3tool command is now installed, which you can confirm with the brew list command:

brew list | grep id3tool
id3tool

and you can see the location where it got installed, using the shell’s type command:

type id3tool
/usr/local/bin/id3tool

You can now run id3tool to examine your MP3 files:

id3tool song.mp3
Filename: song.mp3
Song Title:     Playing The Game              
Artist:         Gentle Giant                  
Album:          The Power And The Glory       
Track:          4
Year:           1974
Genre:          Progressive Rock (0x5C)

Here is a list of common brew commands for managing software packages:

Action

Homebrew command

Search for a package that meets your needs.

brew search part_of_package_name
brew search ...

Get Macintosh Terminal Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.