Remove old files in a directory except files present in an exception file
Clash Royale CLAN TAG #URR8PPP up vote 3 down vote favorite I am writing a shell script to delete old files (older than 60 days) in a directory except few files and these file names are maintained in an exception file present in another directory. I know the following command works for one exception file but i need to check a list of exception files find . ! -name 'file.txt' -type f -exec rm -f + shell-script find ksh share | improve this question edited Nov 20 at 22:52 Rui F Ribeiro 38.2k 14 75 126 asked Jun 28 '16 at 16:32 Balaji 18 3 related: Delete all files in a directory whose name do not match a line in a file list – don_crissti Jun 28 '16 at 17:17 add a comment | up vote 3 down vote favorite I am writing a shell script to delete old files (older than 60 days) in a directory except few files and these file names are maintained in an exception file present in another dir...