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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to include (or exclude) multiple files from find

Status
Not open for further replies.

nerbonne

Technical User
Dec 11, 2006
99
US
Ok, I want to run a find command on specified directories and I want to search for multiple file types like *.exe, *.scr, *.bat, *.pif, etc. The problem is that I can't seem to figure out how to make the find command include multiple file types. Excluding multiple file types (or names) would be an acceptable solution also.

What I have come up with so far is:

find /var/ \( -name '*.exe' -user apache -fprintf /root/suid.txt '%#m %u %p\n' \)

It works great, but I need it to find multiple file types. Running it twice is not acceptable (unless there is a way to append to the log file instead of overwriting it?)

Ref post:
 
This should work:

find / -name "*.zip" -or -name "*.iso
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top