[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using -prune option of find to ignore hidden directories



On Wed, May 03, 2017 at 11:13:46AM -0400, rhkramer@gmail.com 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.


Reply to: