find /opt/homebrew-cask/Caskroom -depth 1 -print -exec \
sh -c "ls -1A {} | grep -v .metadata | head -n -1" \; | grep -B1 -E '^[^\/]' |
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 |
/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 |
brew cask zap opera
brew cask install opera