Brew Cask cleanup orphans

find /opt/homebrew-cask/Caskroom -depth 1 -print -exec \
  sh -c "ls -1A {} | grep -v .metadata | head -n -1" \; | grep -B1 -E '^[^\/]'

output will show you extra files in directory which should be removed

/opt/homebrew-cask/Caskroom/google-chrome
.DS_Store
--
/opt/homebrew-cask/Caskroom/iterm2
.DS_Store
--
/opt/homebrew-cask/Caskroom/opera
24.0.1558.64

also it will display orphaned versions of exact Cask which should be zapped

brew cask zap opera
brew cask install opera

Leave a Reply

Your email address will not be published. Required fields are marked *