I want to ignore all hidden files, but especially .git and .svn ones when searching (and later replacing) files, not I have found that the most basic way to exclude such hid
The thing is -not -name ".*"
does match all files and directories that start with anything but "." - but it doesn't prune them from the search, so you'll get matches from inside hidden directories. To prune paths use -prune
, i.e.:
find $PWD -name ".*" -prune -o -print
(I use $PWD
because otherwise the start of the search "." would also be pruned and there would be no output)