LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 06-06-2007, 01:02 PM   #1
frznchckn
Member
 
Registered: Jun 2006
Location: CA
Distribution: Ubuntu, CentOS, Scientific Linux
Posts: 97

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
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,788

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

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


Reply

Tags
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


All times are GMT -5. The time now is 02:47 AM.

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