How to use the command 'brew outdated' (with examples)
The brew outdated
command is used to list all outdated casks and formulae. It is a useful command to check which packages installed through Homebrew need to be updated. This command provides a way to easily see what needs to be upgraded.
Use case 1: List all outdated casks and formulae
Code:
brew outdated
Motivation: The motivation for using this example is to get a complete list of all outdated casks and formulae installed via Homebrew.
Explanation: This command lists all the outdated casks and formulae by scanning the local Homebrew installation. It provides information about all the packages that have newer versions available.
Example output:
awscli 1.20.17_1 -> 1.21.4
curl 7.78.0 -> 7.79.1
...
Use case 2: List only outdated formulae
Code:
brew outdated --formula
Motivation: The motivation for using this example is to focus only on outdated formulae instead of casks. This is useful when you want to upgrade only the formulae installed via Homebrew.
Explanation: By adding the --formula
option to the brew outdated
command, it filters out the outdated casks and displays only the outdated formulae, narrowing down the list to formulae that require updates.
Example output:
curl 7.78.0 -> 7.79.1
...
Use case 3: List only outdated casks
Code:
brew outdated --cask
Motivation: The motivation for using this example is to focus only on outdated casks instead of formulae. This is useful when you want to upgrade only the casks installed via Homebrew.
Explanation: By adding the --cask
option to the brew outdated
command, it filters out the outdated formulae and displays only the outdated casks, narrowing down the list to casks that require updates.
Example output:
awscli 1.20.17_1 -> 1.21.4
...
Conclusion:
The brew outdated
command is a versatile command that allows you to easily check for outdated packages installed via Homebrew. By using the appropriate options, you can filter the list to focus only on outdated formulae or casks, depending on your needs. This command is helpful for keeping your Homebrew packages updated and ensuring that you have the latest versions of the software you use.