$ cat file_list
abc
def
ghi
I wanted to delete all files on the machine that are not in the file_list
How do I do that ?
$ cat file_list
abc
def
ghi
I wanted to delete all files on the machine that are not in the file_list
How do I do that ?
Assuming you're not going to delete all the files, here is a command to delete all files and directories under a given path only:
grep -ZzxFvf file_list <(find . -mindepth 1 -printf "%P\0") | xargs -0p rm -rf