Operating System - HP-UX
1832541 Members
4628 Online
110043 Solutions
New Discussion

How to get bdf output in MB or in GB

 
SOLVED
Go to solution
john D_3
Frequent Advisor

How to get bdf output in MB or in GB

Hi,

I need something similar to bdf which give me output in MB or in GB, instead of KB. Also I need to import it in excel, is there any way to do that.

Thanks
3 REPLIES 3
A. Clay Stephenson
Acclaimed Contributor

Re: How to get bdf output in MB or in GB

Bill has enhanced his script recently. It's rather good.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1048509&admit=-682735245+1172106976835+28353475

As to your second question, the answer is yes. In fact, I'm sure that there are many ways.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor
Solution

Re: How to get bdf output in MB or in GB

I've attached an updated version of the script here.

This script is much better than bdf because long source devices (like NFS sources) will be split across 2 lines making it very difficult to parse into a spreadsheet. No matter how long the line, it will not be split.

bdfmegs works like regular bdf. You can specify just one location, even the name of a file or the current working directory:

bdfmegs # megabytes
bdfmegs -g # gigabytes
bdfmegs /var/tmp
bdfmegs .

To create a spreadsheet file, just pipe it (with -q to suppress the header if needed) through awk to create a .csv file like this:

bdfmegs -q | |awk '{print $1","$2","$3","$4","$5","$6}' > bdfmegs.csv

and you'll get a file that a spreadsheet program can use (comma delimited values).

(note for current bdfmegs users: added -q option)


Bill Hassell, sysadmin
john D_3
Frequent Advisor

Re: How to get bdf output in MB or in GB

Got the answer