Tuesday, August 16, 2011

Find files ignoring a directory with the find command

I always forget this usage.
The "prune" option will ignore directories before it, so:

find .   -name dir_to_ignore -prune  -o  -name "*flv" -o -name "*avi"

Will find for every file ending with flv or avi, that is not in the dir_to_ignore directory.

No comments:

Post a Comment