Appearance
Update Brew and List Outdated Apps
This script helps you update Homebrew and list outdated applications on your macOS. It also checks for available software updates and outdated macOS apps from the App Store.
Prerequisites
Make sure you have mas (Mac App Store command line interface) installed. You can install it using Homebrew:
sh
brew install masScript Explanation
The script performs the following tasks:
Finding available macOS software updates:
shsoftwareupdate -lThis command lists all available software updates for macOS.
Finding outdated macOS Apps:
shmas outdatedThis command lists all outdated applications installed via the Mac App Store.
Updating Homebrew:
shbrew updateThis command updates Homebrew to the latest version.
Upgrading Homebrew packages:
shbrew upgradeThis command upgrades all installed packages to their latest versions.
Cleaning up Homebrew:
shbrew cleanupThis command removes outdated versions of installed formulas and clears the cache.
Full Script
zsh
#!/bin/zsh
printf "\e[1;33m%s\e[m
" '==> Finding available macOS software'
softwareupdate -l
printf "\e[1;33m%s\e[m
" '==> Finding macOS Apps'
mas outdated
printf "\e[1;33m%s\e[m
" '==> brew update'
brew update
printf "\e[1;33m%s\e[m
" '==> brew upgrade'
brew upgrade
printf "\e[1;33m%s\e[m
" '==> brew cleanup'
brew cleanupCopy and paste the script into a file, for example update_brew.sh, and make it executable:
sh
chmod +x update_brew.shThen, you can run the script:
sh
./update_brew.sh