Skip to content
Posted on:April 27, 2019 at 07:00 AM

How to free up disk space on mac

How to free up disk space on mac

To see the space

ncdu
df -h
diskutil info / | grep "Free Space"

To make space on mac

  • docker
docker system prune --all --force --volumes
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
docker volume rm $(docker volume ls |awk '{print $2}')
rm -rf ~/Library/Containers/com.docker.docker/Data/*
  • yarn cache
yarn cache clean
  • simulator images
xcrun simctl delete unavailable
  • delete homebrew cache
brew cleanup
rm -rf $(brew --cache)
brew cleanup --prune=all
  • ruby
gem cleanup --dryrun
gem cleanup
  • javascript
find . -name "node_modules" -type d -mtime +120 | xargs rm -rf
find . -name "node_modules" -type d | xargs rm -rf
  • user cache
rm -rf ~/Library/Caches
  • system log
sudo rm -rf /private/var/log/*`