Re: Using -prune option of find to ignore hidden directories
On Wednesday, May 03, 2017 11:44:31 AM Greg Wooledge wrote:
> On Wed, May 03, 2017 at 11:13:46AM -0400, firstname.lastname@example.org wrote:
> > On Wednesday, May 03, 2017 10:57:09 AM Richard Owlett wrote:
> > > find /home/richard \( -type d -name .* -prune \) -o -atime -42
> > > -print
> > Maybe next I'd try:
> > find /home/richard -type d -name .* (without the escaped parens)
> No, the problem is the unquoted .* glob. That will expand to an
> indeterminate number of filename arguments, and almost certainly will
> not do what he wants.
> Always quote glob patterns unless you actually want the shell to expand
> them. In this case, he wants find to receive it without expansion.
Not the OP (just one of the responders), but thanks, I hope I can let that
sink into my subconscious (or somewhere ;-) and remember that in the future.
Oh, but in case it wasn't very clear, my intension wasn't so much a specific
recommendation of what might work, but instead, a recommendation on a
methodology to find the problem one's self.