[NTLUG:Discuss] total drive size
MadHat
madhat at unspecific.com
Wed Mar 12 11:49:08 CST 2003
On Wed, 2003-03-12 at 11:25, Rev. wRy wrote:
> Bishop, Cass wrote:
>
> > What I was hoping for is a command, or series of commands that can get the
> > info for each partition then total it up for me. I have started with this
> > to get a list of partition sizes but I'm not sure what to do with it now. I
> > need to total this number and make it human readable(like the df -h option).
> >
> > df|cut -c 20-29|grep -v block
>
ok, try this...
$ for i in `df -k | grep "^/dev" | awk '{print $3}'`; do total=`dc -e
"$i $total + p" 2>/dev/null`; done; total=`dc -e "$total 1024 / p"`;
echo "total Mb used $total"
Will print total Mb used on the computer
It would be easier to script, but...
--
MadHat at Unspecific.com
`But I don't want to go among mad people,' Alice remarked.
`Oh, you can't help that,' said the Cat: `we're all mad here...'
-- Lewis Carroll - _Alice's_Adventures_in_Wonderland_
More information about the Discuss
mailing list