Hi
I am trying to find the file system percentage which is above 60 %.
# bdf | awk -F" " '{ if ($5 > 65) print $5, $6}'| sort -r
80% /home
78% /tmp
75% /var/opt/ignite/recovery/archives/prod
71% /var/adm/crash
71% /opt
above command is successfull,but there is one more mount point "/var/opt/ignite/recovery/archives/nonprod" which is greater than 65%,but I am not getting the output for "/var/opt/ignite/recovery/archives/nonprod".
my doubt is since it uses same "var/opt/ignite/recovery/archives" I guess above bdf command is not reporting correct answer that I am expecting.
What could be done to fix it.
Regards
Madhu
>I am not getting the output for "/var/opt/ignite/recovery/archives/nonprod".
bdf has a "feature" where it splits long lines into two, so unless you make sure that the number of fields is 6, you'll have to read the next line.
Or use Bill's bdfmegs:
Maybe you limit the output to 5 positions, so the awk filter just shows a limited number of 5 directories, even if the directory "/var/opt/ignite/recovery/archives/nonprod" was greater then 65%, but it is out of range...
regards
bdf is very awkward to use due to split lines.
Here is a function that will always return one line for every mountpoint:
function echoBDF1liners
{
bdf 2>/dev/null | while read FS TOT USED AVAIL PERCENT MNT
do
if [ $FS != "Filesystem" ] # skip header
then
if [ "$TOT" = "" ] # check for split lines
then
read TOT USED AVAIL PERCENT MNT
fi
echo $FS $TOT $USED $AVAIL $PERCENT $MNT # single line result
fi
done
return
}Just call this function to return bdf output all on one line.