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.

  • Trackback are closed
  • Comments (0)
  1. No comments yet.