LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 01-15-2009, 03:59 AM   #1
roboxooo
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Rep: Reputation: 0
Using a single "Find" Command to find files bases on multiple criteria


I want to find files having any of the following word in its name
orange, apple, banana ?
How can I do it with a single command?
 
Old 01-15-2009, 04:01 AM   #2
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,443
Blog Entries: 6

Rep: Reputation: 51
http://www.linuxquestions.org/linux/...uick_find_Tips
 
Old 01-15-2009, 04:24 AM   #3
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,676

Rep: Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237
find /path/to/where/your/files/are -name "*orange*" -o -name "*apple*" -o -name "*banana*"

Last edited by Didier Spaier; 01-15-2009 at 04:25 AM. Reason: Typo
 
Old 01-15-2009, 04:26 AM   #4
roboxooo
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Original Poster
Rep: Reputation: 0
this is for single string ABS, i need to find multiple strings through a single find command
 
Old 01-15-2009, 04:27 AM   #5
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad W520
Posts: 4,676

Rep: Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237Reputation: 1237
Whom did you answer to ? My proposal is for several strings.
 
Old 01-15-2009, 04:28 AM   #6
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Something like

find ./ -type f -name '*apple*' -o -name '*banana*'
 
Old 01-15-2009, 05:13 AM   #7
roboxooo
LQ Newbie
 
Registered: Jan 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Didier Spaier View Post
Whom did you answer to ? My proposal is for several strings.
sorry. i answered your_shadow03. Thank you for your help!
 
  


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
What does "2>" do when added to "find" command? O(V)eGA_l2el) Fedora 8 08-06-2007 03:25 AM
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 08:42 AM
using multiple -exec commands in a single find command? Bluemilk Linux - Newbie 4 03-19-2006 11:46 AM
Several "find -exec" and "find | xargs" questions thanhvn Programming 4 12-02-2005 02:04 PM
Help,I can't find my USB mouse when I run "kudzu" command in RH9. aeolus Red Hat 0 03-27-2004 10:14 PM


All times are GMT -5. The time now is 08:46 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