The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Question on Find Utility marlonus999 Shell Programming and Scripting 5 09-19-2007 12:53 AM
question about find command hnhegde UNIX for Dummies Questions & Answers 4 10-26-2006 12:00 PM
Find command question negixx Shell Programming and Scripting 6 07-08-2005 08:43 AM
find ...question. moxxx68 UNIX for Dummies Questions & Answers 2 10-25-2004 07:02 AM
'find' command question xyyz UNIX for Dummies Questions & Answers 2 03-07-2002 04:28 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 12-07-2001
Registered User
 

Join Date: Dec 2000
Location: Greater Dallas area
Posts: 405
find question

Is it possible for find to match on multiple arg's. Basically, I would like to be able to match on name and atime. Basically I want something like:
find . -atime +31 <AND> -name *.log -exec rm -f {} \;

Thanks
__________________
[url=http://chuckb.1le.net/]My website[/url]
Forum Sponsor
  #2  
Old 12-07-2001
flim flam flamma jamma
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
acording to the man page if i read it correctly i dont see any reason it should not work.

none of those options are not supported by the other.
  #3  
Old 12-07-2001
doeboy's Avatar
Registered User
 

Join Date: Oct 2001
Location: Here
Posts: 137
They should work. You have to use -a or -o in between the conditions you specify. (-a for and; -o for or) For example:

find ( -atime 31 ) -a ( -name \*.log ) -exec rm -f {} \;

I'm not sure if the syntax is 100% correct (I didn't test this) but I've done stuff similar to that before in scripts, where I strung like 10 or 11 different conditions on one find command.



Hope this helps
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:05 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