I have a list of files in file.lst
.
Now I want to find all files in a directory dir
which are older than 7 days, except those in the file.lst
file. How can I either modify the find command or remove all entries in file.lst
from the result?
Example:
file.lst
:
a
b
c
Execute:
find -mtime +7 -print > found.lst
found.lst
:
a
d
e
so what I expect is:
d
e
Pipe your
find
command throughgrep -Fxvf
:What the flags mean:
Pipe the find-command to
grep
using the-v
and-f
switchesgrep options:
example: