LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 06-04-2006, 12:27 AM   #1
judgex
LQ Newbie
 
Registered: Jan 2006
Location: Australia
Distribution: Fedora Core 4 and Cygwin
Posts: 14

Rep: Reputation: 0
How to prune more than one directory using GNU find


I know how to prune one directory with find. How do I prune two or more directories?

Code:
find * -wholename 'dirname' -prune -o -print
 
Old 06-04-2006, 12:50 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
find / \( -wholename "/media/*" -o -wholename "/usr/*" -o -wholename "/opt/*" -o -wholename "/etc/*" -o -wholename "/home/*" -o -wholename "/lib/*" -o -wholename "/SuSEdvd*" -o -wholename "/lib64*" -o -wholename "/proc/*" -o -wholename "/sbin/*" \) -prune -o -print

The results are pruned, but the directories are still transversed. If you don't have permissions for a directory of file in one of the pruned patterns, an error message is printed (via stderr ).
 
  


Reply


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where to find the source of gnu/linux shell utilities irfanhab Programming 1 03-16-2006 07:05 AM
Prune Portage tree beaucoup Linux - Software 3 02-05-2005 05:03 PM
How to prune a print & file server to leave minimal services running wolfpeach Linux - Security 4 06-29-2004 07:35 AM
Need help with some commands to prune files... smeenge Linux - Software 2 05-21-2004 06:10 PM
How do I prune logs manually? Jonah W Linux - Newbie 1 08-29-2001 05:21 AM


All times are GMT -5. The time now is 01:27 PM.

Main Menu
Advertisement
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