I have this command:
find /var/cache/pkg -newermt 2020-01-30 | grep 'kdeaccessibility-4.14.3_1'
Which returns nothing. I change it to this:
find /var/cache/pkg -newermt 2020-01-30 -exec ls -D '%F' -l -t -r {} \; | grep 'kdeaccessibility-4.14.3_1'
and this is returned:
-rw-r--r-- 1 root wheel 556 2017-07-14 kdeaccessibility-4.14.3_1-6dc124e39c.txz
lrwxr-xr-x 1 root wheel 40 2017-07-21 kdeaccessibility-4.14.3_1.txz -> kdeaccessibility-4.14.3_1-6dc124e39c.txz
So, the -newermt
option seems to be disabled by the -exec
option. But I do not understand why.
However, if I add the -type f
option then the find works as expected.
find /var/cache/pkg -type f -newermt 2020-01-30 -exec ls -D '%F' -l -t -r {} \; | grep 'kdeaccessibility-4.14.3_1'
Nothing is returned. I infer from this that presence of a symbolic link is causing the behaviour but I do not understand why.
I would think the issue is that your
find ... -exec ls ... {} \;
(without-type f
in thefind
argument list) will runls
also for any matching directories, resulting inls
listing the entire contents of those directories (unless you add the-d
option to thels
argument list).