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
find and remove last week dir kunimi UNIX for Dummies Questions & Answers 1 04-14-2008 04:37 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, remove, and ftp...... peter.herlihy UNIX for Dummies Questions & Answers 1 06-25-2002 03:51 AM
'find' command question xyyz UNIX for Dummies Questions & Answers 2 03-07-2002 04:28 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 12-10-2007
Registered User
 

Join Date: Oct 2004
Posts: 235
question on find and remove command

Hi All,

I have wrote a command to find a and remove all *.apr files ina directory .
Now i got the request as reversed , They want to remove all files except *.apr in the direcory .

Is it possible to do that in a find comand else i have give an explicit find command to all *. files to remove.

Thanks,
Arun
Reply With Quote
Forum Sponsor
  #2  
Old 12-10-2007
Registered User
 

Join Date: Oct 2007
Posts: 155
Code:
# list files in the current dir with "apr" extension
find . -name "*.apr" -type f -maxdepth 1
# list files in the current dir WITHOUT "apr" extension
find . ! -name "*.apr" -type f -maxdepth 1
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




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