Created
September 24, 2021 14:07
-
-
Save HalCanary/04080b482bb61ea79b1dbb87be5a96eb to your computer and use it in GitHub Desktop.
disc_useage_darwin.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
INFO="$(diskutil ap list disk1)" | |
printf 'size: %14d\n' "$(printf %s "$INFO" | sed -n 's/ *Size (Capacity Ceiling): *\([0-9]*\).*/\1/p')" | |
printf 'use: %14d\n' "$(printf %s "$INFO" | sed -n 's/ *Capacity In Use By Volumes: *\([0-9]*\).*/\1/p')" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment