Quote:
That pattern it's a directory tree path rooted at each given file name , so it's not necessarily a directory inside which find will begin its searches.
Notice that post #3's
-exec ls ... output contains duplicate filenames. There is nothing in that find command that prints a matching file name twice (and non-consecutively), and since a directory cannot contain two identically-named files, the shell
must be matching one or more directories with that pattern (in addition to *test* files in tmp, if any).
With a directory path, the
-exec predicates of those find commands will list or attempt to delete every regular file in that directory and its subdirectories, regardless of a file's name.
Quote:
It should != it must.
True, but it's preferable to be precise and avoid this type of unnecessary bug.
Regards,
Alister