LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Use the prune option in find command (http://www.linuxquestions.org/questions/linux-general-1/use-the-prune-option-in-find-command-559667/)

frznchckn 06-06-2007 02:02 PM

Use the prune option in find command
 
I have a nice line of code for a recursive search and replace from the current directory.

find . -type f | xargs perl -pi~ -e 's/oldtext/newtext/g;'

However, I need it to ignore all the .svn directories in the children directories. I've been playing with the -prune option and have not been able to swing it. Any ideas? Thanks.

bigrigdriver 06-06-2007 08:18 PM

Here's an example of using prune (requires a path statement ):
http://www.liamdelahunty.com/tips/li..._directory.php.

You command would then become:
find . -type f -path '/.svn' -prune | xargs perl -pi~ -e 's/oldtext/newtext/g;'


All times are GMT -5. The time now is 11:00 AM.