Paul - The Programmer

simple & stupid
use regular expression to find files
Have Perl modules all in one file

Use -prune to skip directory while finding file

paul posted @ Fri, 12 Jun 2009 18:24:24 +0800 in coding life , 1296 readers

To ignore a whole directory tree, use -prune rather than checking every files in it.

find \(  -path '<directory-to-skip>'  -o -path '<another-directory-to-skip>'  \)  -prune -o -print

Furthermore, take the file nams in consideration.

find \(  -path '<directory-to-skip>'  -o -path '<another-directory-to-skip>'  \)  -prune -o -name '<file-name-pattern>' -print

This trick really saves me couple of  time when I do a find in a large filesystem.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.
  • No match
  • No match

Login *


loading captcha image...
(type the code from the image)
or Ctrl+Enter