LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 01-30-2009, 02:25 PM   #1
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Rep: Reputation: 16
exclude a dir via find in bash?


Currently I have this:
Code:
video=$(find $HOME/* -name *.flv -o -name *.mpg -o -name *.avi | sort)
I would like to exclude a directory (or 2 or more) in this command. I googled "bash exclude", and came up with this, which mentioned the prune option. I tried '-prune', but no cigar. Then I found this, saying "remove deprecated --prune from git-gc". I know what they say about assuming, but I assume this means it isn't being used anymore...?
Please, for the love of God, feel free to correct me in the harshest manner possible...so long as you tell me what to search for to figure this out!
TIA
 
Old 01-30-2009, 02:43 PM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Your second link refers to bash command completion which is entirely different than the find command.
-prune should work for your purposes, although you should have a look at the -wholename option also as they work together.
Your first link refers to this page which may be more helpful:
http://www.liamdelahunty.com/tips/li...irectories.php
 
Old 01-30-2009, 02:52 PM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Take a look at this LQ post for an explanation of -prune http://www.linuxquestions.org/questi...3/#post2653889
 
Old 01-30-2009, 03:32 PM   #4
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Original Poster
Rep: Reputation: 16
Doh! Maybe I shouldn't try to mess with computers, period, while inebriated. God knows I sucked on an ET server a while ago. Danke gnashley!

Thanks colucix; headin' there now.

******
EDIT
******
Works like a charm!
Thanks guys.

Last edited by agrestic; 01-30-2009 at 03:45 PM.
 
  


Reply



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
Using find and grep - how to exclude a result ? graziano1968 Linux - General 13 12-04-2010 10:02 PM
exclude directories from find noir911 Linux - General 3 11-22-2006 06:39 AM
How can I exclude NFS with find with no visit david.dales Linux - General 2 08-24-2005 03:08 AM
exclude a dir with mirrordir jbg Linux - Software 1 08-10-2004 04:42 PM
exclude directory from find ebasi Linux - Software 8 07-17-2004 02:12 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:49 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
Open Source Consulting | Domain Registration