Friday, September 16, 2011

find command complex pattern exclusion


For complex expression you need to include the pattern inside the brackets \( and \)

For example:

find /home/karthik  -name "*.pl" -o -name "*.pm" -o ! \( -name "*.*" -o -type d \)

Include:
1)include the files ending with .pl and .pm

Exclude:
1)exclude the files ending with any other pattern  than the specified "pl" and "pm".
2) to exclude the directories






No comments:

Post a Comment