• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 461
  • Last Modified:

Avoiding 'Find' to search in subdirectories

I want to perform a search using the 'find' command but I don't want it to search into the subdirectories as it's defaulted to.  I'm under IRIX 6.4
0
houde
Asked:
houde
1 Solution
 
ozoCommented:
-prune
0
 
houdeAuthor Commented:
That's what I tried!
If I include it before -name, nothing returned.
If I include it after -name "pattern", I get the same result as without -prune
0
 
delphinusCommented:
To find a find in the current directory, but not recurse into
subdirectories:

find . -name 'pattern' -maxdepth 1

0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
houdeAuthor Commented:
maxdepth is not an option of the find command under IRIX 6.4
0
 
ozoCommented:
find . -print \! -name '.' -prune
0
 
TaliesinCommented:
Forget Find, and use

 ls -laF [dir] | egrep [reg_exp] | pg

or: ls [dir] | grep [simple_reg_exp]
or the short answer ("find like"):   ls -1 | grep [sub_string]

   if you still want to use find, use -prune at the end of
the sentence, but you must be sure you are making the right
search sequence, and not using "-prune" as part of your
search....

   ... with find, you're using an F-16 to kill flies...


0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now