Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 06-06-2007, 01:02 PM   #1
Registered: Jun 2006
Location: TX
Distribution: Debian
Posts: 102

Rep: Reputation: 15
Question 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.
Old 06-06-2007, 07:18 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,893

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
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;'

Last edited by bigrigdriver; 06-06-2007 at 07:19 PM.


commands, find, prune

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prune more than one directory using GNU find judgex Programming 1 06-03-2006 11:50 PM
Prune Portage tree beaucoup Linux - Software 3 02-05-2005 04:03 PM
Need help with some commands to prune files... smeenge Linux - Software 2 05-21-2004 05:10 PM
couldn't find startssl option in apahcectl ybc Linux - General 2 04-16-2003 12:23 AM
How do I prune logs manually? Jonah W Linux - Newbie 1 08-29-2001 04:21 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration