利用 du 和sort 找出大文件、目录

Posted by kunnan on April 24, 2018


  • 利用 du 和sort 进行排查大文件目录
devzkndeMacBook-Pro:Library devzkn$  du -sh * |sort -h

177M  Safari
587M  Logs
857M  Application Support
1.0G  Autosave Information
1.0G  Mail
2.6G  Caches
3.4G  Containers
3.6G  Android
 69G  Developer




  • 在系统根目录下执行du
153G  Users
 27G  Applications
 10G  private
6.4G  usr
  • /Users/devzkn/Library/Developer/Xcode

 39M	Products
126M	DocumentationCache
191M	UserData
414M	iOS Device Logs
823M	Archives
3.0G	DerivedData
 62G	iOS DeviceSupport ---大可直接删除

  • /Users/devzkn/Library/Developer/CoreSimulator
/Users/devzkn/Library/Developer/CoreSimulator/Devices  --- xcrun simctl list devices、

<!-- xcrun simctl help delete -->
So I can either delete the individual device(s):

xcrun simctl delete D24C18BC-268C-4F0B-9CD8-8EFFDE6619E3

or I can bulk delete all of the unavailable ones with:

xcrun simctl delete unavailable

xcrun simctl help

  • garageband
<!-- -->

macintosh hd/applications/ (1.16gb)
macintosh hd/library/application support/garageband (995mb)
macintosh hd/library/application support/logic (880mb)
macintosh hd/library/audio/apple loops (up to 10gb)*

  • /Users/devzkn/Library/Containers

/Users/devzkn/Library/Containers/com.tencent.xinWeChat/Data/Library/Application Support/com.tencent.xinWeChat/2.0b4.0.9/168382edfbf20fc8e6340f8590a006c0/M

  • /Users/devzkn/Pictures/照片图库.photoslibrary
  • tail获取iOS模拟器日志

或者使用:xcrun simctl list devices

  • 删除QuickLook缓存文件

 sudo rm -rf /private/var/folders/

<!-- 这个文件夹内的文件是你在真机测试时安装程序的详情 -->

see also

/Users/devzkn/bin/knpost clean_Mac 利用 du 和sort 找出大文件、目录 -t Terminal

转载请注明: > clean_Mac