Tuesday, June 4, 2013

exclude files in rm

rm `ls | grep -v 'txt$'`

-or-

rm `find . -type f | grep -v 'txt$'`


For file types

rm -rf `ls | grep -v '.gz$'`

No comments:

Post a Comment