Monday, December 14, 2009

How To Find and Delete Files Not Matching MULTIPLE criteria using bash in AIX

"find . ! -name "*.bz2" ! -name "ESPRD*" | xargs rm"

 The above command finds all files in the "current" directory excluding those with "*.bz2" extension and those which start with "ESPRD*" and then deletes them all.

No comments: