Operating System - HP-UX
1823415 Members
2683 Online
109655 Solutions
New Discussion юеВ

how to view in human readble format?

 
SOLVED
Go to solution
fizan
Super Advisor

how to view in human readble format?

team,

we use bdf cmd to view the used and avail space is there any cmd to see directly in GB format, bdf gives in kbytes.
12 REPLIES 12
SoorajCleris
Honored Contributor

Re: how to view in human readble format?

Hi,

you can use

#du -hs
regards,
Sooraj
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity" - Dennis Ritchie
fizan
Super Advisor

Re: how to view in human readble format?

no its showing illegal option.
Steven Schweda
Honored Contributor

Re: how to view in human readble format?

> we use bdf cmd [...]

ON WHAT?

uname -a

Re: how to view in human readble format?

Not in bdf no, but you can use Bill Hassell's bdfmegs utility:

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1369648

which will do what you require (plus a heap of other neat stuff)

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Patrick Wallek
Honored Contributor

Re: how to view in human readble format?

>>#du -hs

Not on HP-UX. There is no '-h' option.

I also recommend Bill Hassels bdfmegs script.
Bill Hassell
Honored Contributor

Re: how to view in human readble format?

Here is a copy of bdfmegs. Use the -g option to see GB rather than MB. Use bdfmegs -h for help on the options.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor
Solution

Re: how to view in human readble format?

Sorry, here is the attachment.


Bill Hassell, sysadmin
Kapil Jha
Honored Contributor

Re: how to view in human readble format?

there is no human readable format in bdf in HPUX like in tru64, sun and linux.

Above script hold good :)

BR,
Kapil+
I am in this small bowl, I wane see the real world......
R.K. #
Honored Contributor

Re: how to view in human readble format?

Hi Fizan,

You can use this single command to print bdf o/p in GB:

# bdf | grep -v Filesystem | awk '{ printf ("%s\t %d\t %d\t %d\t %s\t %s\t \n", $1, $2/1048576, $3/1048576, $4/1048576, $5, $6)}'

Only thing is that it will not print the first line (heading) :(

Note: There are 1 or 2 exceptions unless it works fine on your system.

Regds..
Don't fix what ain't broke
R.K. #
Honored Contributor

Re: how to view in human readble format?

Hi Again,

If you use "%f" in place of "%d", you will get output in decimal places.

Ex:
# bdf | grep -v Filesystem | awk '{ printf ("%s\t %f\t %f\t %f\t %s\t %s\t \n", $1, $2/1048576, $3/1048576, $4/1048576, $5, $6)}'

Don't fix what ain't broke
Johnson Punniyalingam
Honored Contributor

Re: how to view in human readble format?

>>how to view in human readble format? <<

Hi Fizan,

No such , Thing like humean readable format?

even before the (gigbyte) its (kilobyte) measuring term for bits & btyes - Binary Digit Conversion
,

As mentioned above "You can use " Bill's ,excellent :) make our life easy,

or couple choices,

1. Use http://www.onlineconversion.com/computer_base2.htm

2. (total size) / 1024 = (GB)

Thanka,
Johnson
Problems are common to all, but attitude makes the difference
fizan
Super Advisor

Re: how to view in human readble format?

thanks
for bill and all helped me a lot for this conversion by providing scripts.