Computing.Net > Forums > Linux > Free disk space checking in linux

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

Reply to Message Icon

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.


Bye...
Jebaraj



Sponsored Link
Ads by Google

Response Number 1
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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Free disk space checking in linux

Get free disk space in Linux www.computing.net/answers/linux/get-free-disk-space-in-linux-/27598.html

Free disk space checking www.computing.net/answers/linux/free-disk-space-checking/27609.html

how do I check disk space? www.computing.net/answers/linux/how-do-i-check-disk-space/11332.html