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 04:53 AM
question about find command hnhegde UNIX for Dummies Questions & Answers 4 10-26-2006 04:00 PM
Find command question negixx Shell Programming and Scripting 6 07-08-2005 12:43 PM
find ...question. moxxx68 UNIX for Dummies Questions & Answers 2 10-25-2004 11:02 AM
'find' command question xyyz UNIX for Dummies Questions & Answers 2 03-07-2002 07:28 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 12-07-2001
98_1LE 98_1LE is offline Forum Advisor  
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
  #2 (permalink)  
Old 12-07-2001
Optimus_P Optimus_P is offline Forum Advisor  
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 (permalink)  
Old 12-07-2001
doeboy's Avatar
doeboy doeboy is offline
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
Closed Thread

Bookmarks

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 12:59 AM.


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