---

3 Ways to Delete All Files in a Directory Except One or Few Files with Extensions

In this article, we will show you how to delete files in a directory except certain file extensions or types using rm, find and globignore commands.