Operating System - HP-UX
1834909 Members
2434 Online
110071 Solutions
New Discussion

find files with -exec parameter

 
SOLVED
Go to solution
Christian Marquardt_1
Regular Advisor

find files with -exec parameter

Hello Guys,
I cant find the correct syntax, please help me.
I want to find all files with name ora*.aud und use the -exec parameter to count them.
I've tried the following syntax:
find . -name "ora*.aud" -type f -exec ls -la|wc -l \;
This doenst work. Can anyone help me correct the syntax.

regards Christian
4 REPLIES 4
Arunvijai_4
Honored Contributor
Solution

Re: find files with -exec parameter

Hi,

You can try this, # find . -name "ora*aud" -type f | xargs wc -l

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Peter Godron
Honored Contributor

Re: find files with -exec parameter

Christian,
find . -name "ora*.aud" -type f | wc -l
works for me
Christian Marquardt_1
Regular Advisor

Re: find files with -exec parameter

Hello Arun,
I've tried your syntax but it doesnt show me the number of files - it shows all the files.
Any idea???

regards
Christian
Christian Marquardt_1
Regular Advisor

Re: find files with -exec parameter

Hello again,
the syntax:
find . -name "ora*aud" -type f|wc -l
works fine.

Thanks!