Skip to content

Instantly share code, notes, and snippets.

@shau-lok
Last active January 17, 2019 23:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shau-lok/21f005007b57df818fae3f110f8cc4dd to your computer and use it in GitHub Desktop.
Save shau-lok/21f005007b57df818fae3f110f8cc4dd to your computer and use it in GitHub Desktop.
terminal-du,df
# get current dir size!
$ du -sh
>>> 224M .
# get specific file (logs) size!
$ du -sh logs
>>> 2.7M logs
# get disk useage
$ df -h
>>>
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk1s1 113Gi 94Gi 14Gi 88% 2520858 9223372036852254949 0% /
devfs 187Ki 187Ki 0Bi 100% 648 0 100% /dev
/dev/disk1s4 113Gi 4.0Gi 14Gi 23% 4 9223372036854775803 0% /private/var/vm
map -hosts 0Bi 0Bi 0Bi 100% 0 0 100% /net
map auto_home 0Bi 0Bi 0Bi 100% 0 0 100% /home
# get each folder size
$ du -h -d 1
>>>
➜ github.com du -h -d 1
6.3M ./nikto
72M ./google-io-2014-compat
28K ./personal
162M ./RengwuxianRxjava
60M ./shadowsocks-mac-dmg
60M ./JJSearchViewAnim
34M ./MyApplication
27M ./platform_packages_apps_mms
35M ./JazzyListView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment