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

Free disk space checking in linux

Reply to Message Icon

Original Message
Name: judson_jebaraj8
Date: May 16, 2005 at 03:55:29 Pacific
Subject: Free disk space checking in linux
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


Report Offensive Message For Removal

Response Number 1
Name: David Perry
Date: May 16, 2005 at 04:37:22 Pacific
Subject: Free disk space checking in linux
Reply: (edit)

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


Report Offensive Follow Up For Removal

Response Number 2
Name: 3Dave
Date: May 17, 2005 at 04:32:55 Pacific
Subject: Free disk space checking in linux
Reply: (edit)

I sometimes prefer a "human readable" output which can be performed by adding an "h" switch:
$ df -h


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Free disk space checking in linux

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software