Skip to content

Instantly share code, notes, and snippets.

@cdeath
Last active October 8, 2023 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdeath/dcc57de4d0bbc1d4e0cbb9c167d9a662 to your computer and use it in GitHub Desktop.
Save cdeath/dcc57de4d0bbc1d4e0cbb9c167d9a662 to your computer and use it in GitHub Desktop.
keep your mac updated and clean

Tidying up your mac

softwareupdate

softwareupdate -i -a --force --agree-to-license
sudo softwareupdate -i -a -R --force --agree-to-license

homebrew

brew upgrade --greedy --force
brew cleanup
rm -rf $(brew --cache)

brew uninstall --zap {cask}

brew leaves
brew deps --tree --installed

brew autoremove

brew doctor

npm

npm i -g npm
npm update -g
npm cache clean --force

pnpm

pnpm add -g pnpm
pnpm up --global --latest
pnpm store prune

rm -rf $(pnpm store path)

yarn

yarn global upgrade
yarn cache clean

fnm

fnm install lts-latest

asdf

asdf plugin update --all

ruby

gem update --system
gem update
gem cleanup

gem pristine --all

python

pip install -U `pip list --outdated | awk 'NR>2 {print $1}'`
pip-review --local --interactive
pip cache purge

docker

docker stop $(docker ps -a -q)
docker system prune -a

delete a file recursively

find / -name '.DS_Store' -type f -delete

disk usage sorted by size descending

du -sh * | sort -hr
du -hd {depth} * | sort -hr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment