The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to prune multiple branches with find? siegfried UNIX for Dummies Questions & Answers 1 04-11-2008 04:52 AM
find command with prune help venu_nbk UNIX for Dummies Questions & Answers 2 05-28-2007 07:25 AM
finding files using prune option subodh.sharma Shell Programming and Scripting 1 11-02-2005 11:11 AM
Use -prune with find command on AIX FuzzySlippers UNIX for Dummies Questions & Answers 5 11-08-2002 09:24 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-19-2006
highlt highlt is offline
Registered User
  
 

Join Date: Dec 2006
Posts: 8
find with prune option

Hello-

I'm trying to write a find command that will exclude certain directories to speed up the find and search the rest of the directory structure to list any files that contain the specified values listed in my egrep.

Specifically, I want the command below to search the current directory and all sub-directories EXCEPT for the "log" and "out" directories and give me a list of file names that contain "sun1216, sun1586, sun1153, PRIVIS1, PRIVIS2". I expected the command below to do the trick but it appears to not work.

find . -follow \( -name "log" -o -name "out" \)
-prune | xargs egrep -li "sun1216|sun1586|sun1153|PRIVIS1|PRIVIS2"

Any suggestions on what's wrong?
Any suggestion on using exec versus xargs?

Thanks
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:25 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0