Skip to content

Latest commit

 

History

History
16 lines (13 loc) · 425 Bytes

homebrew-package-installed.md

File metadata and controls

16 lines (13 loc) · 425 Bytes

homebrew - Check If a Package Is Installed

To check if a Homebrew package is installed, execute the following. The example below checks to see if fzf is installed.

brew ls --versions fzf

To utilize within a script, use with an if statement.

if [ -z "$(brew ls --versions fzf)" ]; then
    echo 'the package fzf is not installed'
else
    echo 'the package fzf is installed'
fi