LinuxQuestions.org
Review your favorite Linux distribution.
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 07-16-2009, 02:48 PM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Rep: Reputation: 46
Searching for a folder on entire system


I thought by doing the following command it would search through the entire system and find all folders who names start with blabla, but it apppears to only be searching at the root level of the path i specified. What did I do wrong?


find / -type d -name blabla*
 
Old 07-16-2009, 02:52 PM   #2
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
try:
Code:
find / -type d -iname 'blabla*'
 
Old 07-16-2009, 03:24 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Ummmmmm....

All -iname does is to make it case-insensitive

I'm pretty sure that "find /" searches the whole tree unless some other option is used......??)

But you very likely DO need the quotes---otherwise the shell will expand the "*" before running find. ***strange things*** can happen.

SO:

Code:
find / -type d -name "blabla*"
 
Old 07-16-2009, 03:26 PM   #4
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
thanks. I will give it a try with quotes, I didn't think iname had anything to do with it. i was getting some funky results.
 
Old 07-16-2009, 03:29 PM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by pixellany View Post
Ummmmmm....

All -iname does is to make it case-insensitive

I'm pretty sure that "find /" searches the whole tree unless some other option is used......??)

But you very likely DO need the quotes---otherwise the shell will expand the "*" before running find. ***strange things*** can happen.

SO:

Code:
find / -type d -name "blabla*"
That ended up doing it, thanks Pixellany!
 
Old 07-17-2009, 06:29 AM   #6
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
-iname is for case sensitive... I just tend to do it by default as I rarely know the casing of what I'm searching... sorry for the confusion.
 
Old 07-17-2009, 09:02 AM   #7
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
no problem. at least i learned that -iname is for not case-sensitive ;-)
 
  


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
Batch convert video in entire folder using ffmpeg Steven Hyde Linux - General 4 05-03-2008 06:28 PM
Searching The Entire System carlosinfl Linux - General 4 10-14-2007 10:10 PM
Problems searching entire files system. thekillerbean Linux - Software 12 02-03-2006 09:29 AM
FTP need to transfer entire folder recursively rolster Linux - Newbie 6 02-02-2006 09:54 AM
How to get an entire folder trough ftp with one command. amnesiac Linux - Software 3 08-31-2003 04:24 PM


All times are GMT -5. The time now is 06:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration