how to delete all files in a directory EXCEPT some specified exclusions?
Hi everybody,
how can I delete all files in a directory that DON'T match an exclusion list? For example, I have a file called "exclusions.txt", containing Code:
File1 Any thoughts would be great! Thank you again :) |
If you read the "man" page for "rm" there is a way to read a list from a file. But you would need to invert the exclusions list into a delete list.
|
Quote:
Code:
File2 Code:
cat delete.list | xargs rm -v Code:
ls -1 > delete.list |
All times are GMT -5. The time now is 12:49 AM. |