The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



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
performing cleanup when a job finishes ChicagoBlues Shell Programming and Scripting 4 03-06-2008 12:41 PM
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
performing a task at regular intervals mridula High Level Programming 2 11-14-2005 05:26 AM
Question: non-recursive find syntax alexkav UNIX for Dummies Questions & Answers 6 03-10-2005 07:46 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-05-2002
christallott christallott is offline
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 :-(
  #2 (permalink)  
Old 09-06-2002
hassan2 hassan2 is offline Forum Advisor  
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 (permalink)  
Old 09-06-2002
psera psera is offline
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
  #4 (permalink)  
Old 09-06-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
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.
Closed Thread

Bookmarks

Tags
grep or

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0