find * ...
as a shell command line,
* is a glob that is expanded by the shell to the (lexically sorted) list of non-hidden entries in the current directory (with some shells, that would be only the entries that contain only valid characters as
* as a pattern means 0 or more characters).
So, if the current directory contains these entries:
find will be called with these arguments:
find will most likely complain about that
-foo- that is an invalid option or predicate.
Even if you use:
find -- * ...
That won't work properly for files named
-- only tells
find to stop looking for options (like
-H) not for predicates.
You could use:
find ./* ...
to avoid the problems, but then again, that would omit hidden files, could omit files with invalid characters or break (with arg list too long) if there are a lot of files in the current directory.
find . ...
You only pass
. is the current directory. Then it's
find, not the shell that will look for files in there (includes
. at depth 0, all the entries except
.. (other hidden entries included) at depth 1, and all other entries for subdirectories (still excluding
You'd only want to use:
find ./* ...
If you wanted the list of files at depth 1 (and depth 1 only) to be sorted and wanted to exclude hidden files at depth 1 (and again at depth 1 only). Which would be very unlikely.
If you want to exclude hidden files, add a
! -name '.*' Or
-name '[!.]*' (though beware of file names with invalid characters, and that would also include the top level directory given to
. which happens to match that pattern).
If you wanted sorting at every level, you'd probably want to resort to
zsh and its recursive globbing with glob qualifiers.
The reason you're getting different results is most probably that in
find *, find starts by looking (is being told to look) into the first file or directory in the current directory in alphabetical order, and with
find ., it looks at
. itself but then next the first file or directory in there in a different order (could be the order that entries are stored in the directory, but some
find implementations also sort the list by inode number as an attempt to minimise disk head seeks).
BTW, a better way to write your command would probably be:
find . \( -name @eaDir -o -iname .DS_Store -o -iname Thumbs.db \) \
-prune -o -mtime -25 -type f -print
That is tell
find to ignore those directories and their content altogether (not even attempt to look inside them).