Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Free disk space checking in linux
Name: judson_jebaraj8 Date: May 16, 2005 at 03:55:29 Pacific OS: RedHat Linux CPU/Ram: 256
Comment:
Hi EveryBody
I want check the free space in my hard disk, how check, suppose i'm having 10GB HDD, i used only 7GB, i want check how much remaining space is available. Any command available for that, pls... help me.
Name: David Perry Date: May 16, 2005 at 04:37:22 Pacific
Reply:
df -k du -sk directory
#!/bin/ksh MAILTO="user@host.com" echo "df -k output for `date` `uname -a`" > /tmp/df.out case `uname -s` in SunOS | Linux | OSF1 | UNIX_SV | FreeBSD ) if [ -s "/etc/redhat-release" ] ; then cat /etc/redhat-release >> /tmp/df.out ; fi set -- `df -k | sed -e 's/%//g' | awk '/^\/dev/ { printf("%s %s\n", $5, $6) }'` ;; HP-UX ) set -- `bdf | sed -e 's/%//g' | awk '/^\/dev/ { printf("%s %s\n", $5, $6) }'` ;; AIX ) set -- `df -k | sed -e 's/%//g' | awk '/^\/dev/ { printf("%s %s\n", $4, $7) }'` ;; esac
while [ $# -ge 2 ] ; do CAPACITY=$1 FS=$2 shift 2
if [ $CAPACITY -gt 90 ] ; then echo "$FS is at $CAPACITY %" >> /tmp/df.out fi done if [ `wc -l /tmp/df.out | awk '{ print $1 }'` -ge 2 ] ; then cat /tmp/df.out | mail -s "`date`" $MAILTO fi
0
Response Number 2
Name: 3Dave Date: May 17, 2005 at 04:32:55 Pacific
Reply:
I sometimes prefer a "human readable" output which can be performed by adding an "h" switch: $ df -h
Summary: Hello All, I need to write a C Program in Linux to get free disk space available in the system. Kindly help me out and let me know how to go about with this. Thanks in Advance Regards, Neeraja ...
Summary: Hi buddies I want check the free space in my hard disk, how check, suppose i'm having 10GB HDD, i used only 7GB, i want check how much remaining space is available. Bye... Jebaraj ...