This command recursively finds every file
matching the glob pattern *.*
(name.extension
)
in the working directory,
excluding child directories whose names start with .
.
This is useful for skipping various VCS directories, for instance.
find . -type d -path './.*' -prune -o -type f -name '*.*' -print
There is a lot of misleading and confusing information on the Internet about how to achieve this.
One important thing to remember is that find
prepends ./
to every result,
accounting for the first part of the -path
argument.
The -name
argument is included to demonstrate additional filters.
Omitting it would yield every file.