![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| making a recursive find more useful.. | spanish_tony | UNIX for Dummies Questions & Answers | 3 | 03-14-2007 05:48 AM |
| find file with date and recursive search for a text | rosh0623 | UNIX for Advanced & Expert Users | 10 | 08-16-2006 02:27 PM |
| Question: non-recursive find syntax | alexkav | UNIX for Dummies Questions & Answers | 6 | 03-10-2005 07:46 AM |
| command find returned bash: /usr/bin/find: Argument list too long | yacsil | Shell Programming and Scripting | 1 | 12-15-2003 06:38 PM |
| Performing a non-recursive find in Unix | christallott | UNIX for Advanced & Expert Users | 3 | 09-06-2002 09:13 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Non recursive find command
Hi,
I have question is related to find command. I want to find command should search in current folder only not recursive mode(sub-folders). I found a one way of, find . \( -name success -prune \) -o -name "Rajini*" How ever, my current folder is having lots sub-folders and am not interested to give all sub-folders names with find command. Waiting for your valuable reply. Thanks, Naga ![]() |
|
||||
|
If you don't want recursion, is find even the right command?
Code:
echo Rajini* |
|
||||
|
Thanks for your reply.
As you know, simple find by default recrusive option is true. As you quoted, i tried -maxdepth, how ever it's not working with my OS. PFB details, (am using SunOS 5.9) > find . -name "Rajini*" -maxdepth 1 find: bad option -maxdepth find: path-list predicate-list Is there any other apart from -maxdepth? Waiting for your valuable reply Thanks, Naga ![]() |
|
||||
|
You can feed the output of find to grep, but that won't prevent it from going recursive, just remove the subdirectories from the output (which is a problem if you want to avoid the overhead of recursive processing, but perhaps acceptable if that's not the problem you are trying to solve).
I'm still thinking you should not be using find in the first place, though. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|