LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 02: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, 03:01 AM   #2
your_shadow03
Senior Member
 
Registered: Jun 2008
Location: Germany
Distribution: Slackware
Posts: 1,466
Blog Entries: 6

Rep: Reputation: 51
http://www.linuxquestions.org/linux/...uick_find_Tips
 
Old 01-15-2009, 03:24 AM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

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

Last edited by Didier Spaier; 01-15-2009 at 03:25 AM. Reason: Typo
 
Old 01-15-2009, 03: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, 03:27 AM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Whom did you answer to ? My proposal is for several strings.
 
Old 01-15-2009, 03:28 AM   #6
billymayday
LQ 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, 04: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:55 AM.

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