Operating System - HP-UX
1820879 Members
3600 Online
109628 Solutions
New Discussion юеВ

Displaying an LL or BDF in MB/GB instead of KB?

 
SOLVED
Go to solution
Peter A. Berger Jr.
Regular Advisor

Displaying an LL or BDF in MB/GB instead of KB?

Unix newb here.
Was wondering if there's a script or method to display the ll or bdf commands in megabytes and or gigabytes instead of bytes/kilobytes. KB's are so 1970's. Any help/tips/tricks would be greatly appreciated.
-- Windows convert.
7 REPLIES 7
Patrick Wallek
Honored Contributor

Re: Displaying an LL or BDF in MB/GB instead of KB?

No, there is no way I know of to have ll display in anything other than BYTES.

As for BDF - check out the bdfmegs script located here:
ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/coolscripts

This will display bdf output in MB. I haven't ever looked at this script, but you might be able to modify it so that it displays in GB.
Patrick Wallek
Honored Contributor

Re: Displaying an LL or BDF in MB/GB instead of KB?

My first statement above is not entirely correct. You can't make the native HP-UX ls command display in anything other than bytes.

You could, however, download and install the GNU Coreutils package, which has its own version of ls, which does allow you to modify how file sizes are displayed.

The GNU Coreutils is available here:
http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-5.0.91/
Steven E. Protter
Exalted Contributor

Re: Displaying an LL or BDF in MB/GB instead of KB?

I wrote a script for that.

Attached

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Displaying an LL or BDF in MB/GB instead of KB?

Being distracted and scatter brained today, I produced a gbdf for Gigabyes. You'll have to make an adjustment if you want to change the precision.

SEP

Attached
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor
Solution

Re: Displaying an LL or BDF in MB/GB instead of KB?

Attached is lls, a script that shows files sorted by size (largest first) with Gb, Mb, and Kb magnitudes.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: Displaying an LL or BDF in MB/GB instead of KB?

Attached is bdfmegs which ALWAYS shows each filesystem on 1 line no matter how long and displays in Mb. By using the -v option, you can see the VxFS version, whether it supports large files and block/frag size for each mounted filesystem.


Bill Hassell, sysadmin
Peter A. Berger Jr.
Regular Advisor

Re: Displaying an LL or BDF in MB/GB instead of KB?

You guys rock! Those scripts were exactly what I needed. I looked at the code and it's a shame that it takes so much just to change the display, but I appreciate the help for a UX newb.