The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
performing cleanup when a job finishes ChicagoBlues Shell Programming and Scripting 4 03-06-2008 09:41 AM
making a recursive find more useful.. spanish_tony UNIX for Dummies Questions & Answers 3 03-14-2007 02:48 AM
find file with date and recursive search for a text rosh0623 UNIX for Advanced & Expert Users 10 08-16-2006 11:27 AM
performing a task at regular intervals mridula High Level Programming 2 11-14-2005 02:26 AM
Question: non-recursive find syntax alexkav UNIX for Dummies Questions & Answers 6 03-10-2005 04:46 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-05-2002
Registered User
 

Join Date: Sep 2002
Posts: 1
Question Performing a non-recursive find in Unix

I need to perform a non-recursive find in Unix. Sounds simple, but it doesn't actually work. The command ALWAYS searches through the subdirectories.

Any ideas? I am on DEC Unix :-(
Forum Sponsor
  #2  
Old 09-06-2002
Registered User
 

Join Date: Mar 2002
Location: London, England
Posts: 262
use the find command with -xdev option

eg

find / -name (search file) -xdev
  #3  
Old 09-06-2002
Registered User
 

Join Date: Sep 2002
Location: INDIA->TamilNadu-> chennai
Posts: 3
Arrow No Problem !! Take it easyyy

Ur problem is that U had not gone the man pages of find
Please make sure U read the help pages of find .

Acctually find ->> utility recursively descends the directory
hierarchy for each path seeking files that match......
so please checkout with UNIX man pages and try it

it would fun if U could use grep or fgrep with find ....
Please try it and reply
__________________
psera
  #4  
Old 09-06-2002
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
The xdev option will work only if all of his subdirectories are mount points. Not exactly a general solution.

If want to keep find in one directory, replace
find dir ...
with:
find dir \( ! -name dir -prune \) ...

So
find . -type d -print
will list each subdirectory all the way down your directory structure. But:
find . \( ! -name dir -prune \) -type d -print
will list only the subdirectories in the current directory.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 01:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0