How to delete all but one file in linux directory
ls *| grep -v FileName | xargs rm -rf
Using this command you can delete all files except the one listed.
ls *| grep -v FileName | xargs rm -rf
Using this command you can delete all files except the one listed.
No comments yet.