Reputation: 110143
I have the following find command to find all files in a Volume:
find ./ -type f
How would I exclude all files that start with .
? Also, I do want to include folders that being with .
For example:
.Trashes/file.php
folder/.hidden_file.php
What would be the correct find
command for this?
Upvotes: 18
Views: 89621
Reputation: 2116
To exclude all files whose names begin with .
:
find ./ -type f ! -name '.*'
This will search in all directories (even if their names start with a dot), descending from the current directory, for regular files whose names do not begin with a dot (! -name '.*'
).
Upvotes: 25