sajad torkamani

Homebrew in a nutshell

The Homebrew package manager makes it easy to install and manage macOS software packages (called formulae in Homebrew parlance) or applications (called casks). For example, we can install MySQL by running a single command from the terminal:

brew install mysql

Homebrew is a wonderful project in so many ways. Each formula or cask is well documented (see mysql example) and you can see what installing a homebrew formula does by inspecting the formula or cask code that’s linked on the documentation page (look for “ Formula code on GitHub” or “Cask code on Github”, or run brew edit <formula> once you’ve installed the formula).

If you’re coming from the Linux / Ubuntu world, you can think of Homebrew as a combination of apt and systemctl.

What are services?

Some packages require background processes to always run. For example, the mysql package will include the mysqld program which needs to run in the background and listen for database connections.

To make our lives easier, Homebrew lets us manage these background processes using the brew services command. Here are some common commands for managing services:

Service commands

List services

brew services

Start service

brew services start <service>

Stop service

brew services stop <service>

Restart service

brew services restart <service>

Show service info

brew services info <service>
Tagged: macOS