-   Linux - General (
-   -   Use the prune option in find command (

frznchckn 06-06-2007 01: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 07:18 PM

Here's an example of using prune (requires a path statement ):

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 06:46 PM.