The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find command sort options? mavsman UNIX for Dummies Questions & Answers 6 04-01-2008 04:20 PM
Question on Find Utility marlonus999 Shell Programming and Scripting 5 09-19-2007 04:53 AM
find options don't work in script mattd Shell Programming and Scripting 3 04-30-2007 11:31 AM
Find command with prune and exec options Sebarry UNIX for Dummies Questions & Answers 2 06-19-2006 05:07 AM
Threaded 'find' utility mariuca High Level Programming 1 10-27-2004 06:57 PM

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 07-14-2006
amarnath amarnath is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 7
options in FIND utility

hi folks,

I want to select all files older than 13 days from a specified directory
for that i used

find /home/amar -name '*.*' -mtime 13

but it gives me all the files from subdirectories also, I dont want that

I want files only from /home/amar and not from /home/amar/abc/..

which option is suitable here -depth,-mindepth,-prune ?
how to use it ???
  #2 (permalink)  
Old 07-14-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2006
Posts: 360
-maxdepth 1
  #3 (permalink)  
Old 07-14-2006
amarnath amarnath is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 7
thanx Hitori,

but i am having problem that in the statement how to use it ??


find /home/amar -maxdepth 1 -name '*.*' -mtime 13

find /home/amar -name '*.*' -mtime 13 -maxdepth 1

find -maxdepth 1 /home/amar -name '*.*' -mtime 13

are not working
  #4 (permalink)  
Old 07-14-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2006
Posts: 360
May be you forget to add '+' to the -mtime's argument option.
this works fine for me (with another directory ):

$ find /home/amar -maxdepth 1 -name '*.*' -mtime +13
  #5 (permalink)  
Old 07-14-2006
preethgideon preethgideon is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 71
It says find: bad option -maxdepth

Last edited by preethgideon; 07-14-2006 at 07:35 AM..
  #6 (permalink)  
Old 07-14-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2006
Posts: 360
Then you out of luck. What version of find do you use?
Closed Thread

Bookmarks

Tags
mtime

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 01:01 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