The UNIX and Linux Forums  

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



Thread: FIND command
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 12-06-2005
anil1j anil1j is offline
Registered User
 

Join Date: Dec 2005
Posts: 2
FIND command

I am trying to delete all *.log files in current folder. Something like this.
find . -name "*.log" -atime +3 | xargs -i {} rm {}

But the problem is, it deletes *.log files in subdirectories too. I do not want to do that.

My question is "How can I exclude subdirectories in FIND command?"

Please help me!
Thank you
Reply With Quote
Forum Sponsor