Created
August 3, 2023 06:14
-
-
Save zxt5105515/a28f57bb813829504035654f635c9903 to your computer and use it in GitHub Desktop.
get disk free space in gigabytes
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
diskFree=`df -g / |sed -n '2p'|awk '{print $4}'` | |
echo "diskFree :$diskFree" | |
if ((diskFree<5)); then | |
echo "warning, disk is less then 5GB! please check your disk!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment