Saravana's Musings
Friday, October 27, 2017
Delete all but one file
Delete all but one file:
ls | grep -v testfile.tar | xargs rm
So, all files except testfile.tar will be deleted.
use "xargs rm -rf" if you wish to delete directories as well.
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment