Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get total file number of one vg, thanks. 2

Status
Not open for further replies.

we2aresame

Technical User
Feb 10, 2003
128
0
0
CA
thanks.
 
for i in $(lsvg -l rootvg | tail +6l | awk '{print $7}')
do
find $i -type f | xargs ls | wc -l
done


Modify for your preferences, like totaling all filesystems, etc.
 
#!/bin/ksh

x=0
for i in $(lsvg -l rootvg | tail +6l | awk '{print $7}')
do
cnt=$(find $i -type f | xargs ls | wc -l | awk '{print $1}')
((x+=cnt))
done
print $x

This will total all files in all filesystems.
 
Only files? Then maybe this short script. You need to be root to run it.
[tt]
#!/bin/ksh
find $(lsvgfs rootvg) -xdev -type f | wc -l
[/tt]
 
maybe you can also use ncheck command to count files in fs...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top