Computing.Net > Forums > Unix > Unix Total Hard Disk Capacity

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.

Unix Total Hard Disk Capacity

Reply to Message Icon

Name: Parimal
Date: October 1, 2002 at 07:15:10 Pacific
OS: All Unix Flavors
CPU/Ram: All
Comment:

I need a command or a script which can give following information for all unix flavors
1)Total Hard Disk Capacity, it should include all hard disk installed
2) Free Space of Hard Disks
3) Used Space of Hard Disks




Sponsored Link
Ads by Google

Response Number 1
Name: jimbo
Date: October 1, 2002 at 07:27:44 Pacific
Reply:

>Total Hard Disk Capacity, it should include
>all hard disk installed

(Assuming you meant hard disks mounted by the system) You can have a drive installed, but the system won't know options #2 & #3.

Your best solution is to pipe a df -k command through awk and have it total up the relevant columns for you.
-jim


0

Response Number 2
Name: Parimal
Date: October 1, 2002 at 07:31:02 Pacific
Reply:

Yeh Jim,
Thanks for the input. I mean all physical disk drives.
How about this command, can you verify this ?

1) Below Command will give you Total Hard Disk Capacity in MB
df -k|sed 1d|awk '{total += $2} \
END {print total/1000}'

Below Command will give you Available Space(Free Space) in MB
2) df -k | sed 1d | awk '{total += $4} \
END {print total/1000}'
-P


0

Response Number 3
Name: jimbo
Date: October 1, 2002 at 07:41:38 Pacific
Reply:

Yeah, that's basically what i mean. Sorry i can't test at the moment. i'm on a win98 with cygwin and the df command output is different. You can make those into one command by making the variable names (total, avail, used) different for each column. Check this script for what i mean:

http://www.computing.net/unix/wwwboard/forum/3886.html

-jim


0

Response Number 4
Name: subrata sarkar
Date: October 22, 2002 at 08:24:06 Pacific
Reply:

In HP-UX N class use the command bdf.
it is Berkley version.It gives total hard disk space,free space,used space,filesystem,%used and mount point.


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 Unix Forum Home


Sponsored links

Ads by Google


Results for: Unix Total Hard Disk Capacity

help to mount the hard-disk www.computing.net/answers/unix/help-to-mount-the-harddisk/2424.html

hard disk clonning on SCO UNIX www.computing.net/answers/unix/hard-disk-clonning-on-sco-unix/5774.html

How to find CPU usage, RAM, Hard Disk www.computing.net/answers/unix/how-to-find-cpu-usage-ram-hard-disk/3417.html