Created
February 14, 2018 23:52
-
-
Save RonanKER/891d4e4597db923cfca6357fe550c349 to your computer and use it in GitHub Desktop.
Classic simple script to give disk info
This file contains hidden or 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 | |
DISC=$1 | |
[ -z "$DISC" ] && DISC=/ | |
PARTITION=`df -h |grep $DISC |awk '{print $1}'` | |
SIZE=`df -h|grep $DISC|awk '{print $2}'` | |
USED=`df -h|grep $DISC|awk '{print $3}'` | |
FREE=`df -h|grep $DISC|awk '{print $4}'` | |
echo Partition: $PARTITION | |
echo Total size: $SIZE | |
echo Used space: $USED | |
echo Free space: $FREE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment