-
Notifications
You must be signed in to change notification settings - Fork 34
Bash
Victor Barrera edited this page Jan 13, 2017
·
8 revisions
How to remove all files except the ones you want:
First, expand rm capabilities by:
shopt -s extglob
Then use find and remove:
find . ! -name 'file.txt' -type f -exec rm -f {} +