1838598 Members
4203 Online
110128 Solutions
New Discussion

Re: command bdf

 
SOLVED
Go to solution
Eli Daniel
Super Advisor

command bdf

good morning,
when I run the command "bdf" shows the list of FileSystem

This list I can order it?
example:
/ Var
/ Opt
/ App1
/ App1/data1
/ App2/app2
/ App2

order:
/ App2/app2
/ App2
/ App1/data1
/ App1
/ Opt
/ Var

This is possible?
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor
Solution

Re: command bdf

Hi Eli:

Use 'sort' :

# bdf|grep -v Filesystem|sort -k6,6

Regards!

...JRF...
Eli Daniel
Super Advisor

Re: command bdf

it can be done automatically?
The list shows the FileSystem in the order of fstab?
James R. Ferguson
Acclaimed Contributor

Re: command bdf

Hi Eli:

> it can be done automatically?

Well, you could simply alias 'bdf' in your '${HOME}/.profile' like:

# alias bdf='bdf|grep -v Filesystem|sort -k6,6'

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: command bdf

I think you'll find bdfmegs most useful. You can sort on any column (source, size, used, etc). You can also select a specific volume group or groups, sum the total space, etc. It is attached to this response. Here's the usage screen:


Usage: bdfmegs [ -cghlNPpqstuVv ] [ ]
where:
-c # = Sort on column #
-d = Toggle divisor (1000 or 1024, current=1000)
-g = show gigabytes, otherwise megabytes
-h = Usage (return code=0, Usage to stdout)
-l = local (no NFS)
-M = skip (grep -v) mountpoints
-N = skip one or more volume groups
Repeat -N or use commas: -N vg10,vg24
-p ## = highlight % -ge ##
-P ## = show only % -ge ##
-q = suppress header line and no char enhancements
-s = summarize total, used and available
-t = specifc filesystem: (hfs vxfs nfs cdfs cifs autofs DevFS)
-u = usage (return code=0, Usage to stdout)
-v = verbose (type, version, largefiles)
(version info needs read permission for mountpoint)
-V = select one or more volume groups
Repeat -V or use commas: -V vg00,vg01

File(s) or dirpath(s) may be specified to reduce the output of bdfmegs:

bdfmegs -vg /usr/contrib/bin /var/tmp

If bdfmegs is run as bdfgigs (ie, a link), then -g is default.
(bdfmegs ver 5.5_Dec2009)


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: command bdf

>order:
/App2/app2
/App2
/App1/data1
/App1
/Opt
/Var
>This is possible?

I'm not sure how you would do that. You have App2 before App1 then you have Opt then Var. (Was that a typo?)

If you want the subdirectories before the parents, you could append a ":" to the end and then "/" would sort before the ":". Then you could strip off the ":".
Viktor Balogh
Honored Contributor

Re: command bdf

Hi,

If you prefer it WITH the header, then you could do:

# bdf | head -n 1; bdf | grep -v Filesystem | sort -k6,6

(Ok, I know it's not performance-optimized running bdf two times, but it works like a charm.)
****
Unix operates with beer.
Eli Daniel
Super Advisor

Re: command bdf

Thanks