Re: Using -prune option of find to ignore hidden directories
On 05/03/2017 07:44 PM, email@example.com wrote:
> Hmm, maybe I don't need a response to this--I think if I read Greg Wooledge's
> post (next in the thread) and experiment (tomorrow or later ;-) with his
> script, I'll get the idea...
> On Wednesday, May 03, 2017 10:29:08 PM firstname.lastname@example.org wrote:
>> On Wednesday, May 03, 2017 04:22:57 PM email@example.com wrote:
>>> FWIW, a trick to see what's really going on is to prepend an echo
>>> before all that:
>>> echo find /home/richard -type d -name .*
>> That seems like a helpful trick, but I'm not sure what I should see.
>> On my (Wheezy) system, I tried that, i.e.:
>> echo find /home/<my_username> -type d -name .*
>> echo find /home/<my_username> -type d -name '.*'
>> and, in both cases, I got the same result:
>> find /home/<my_username> -type d -name .*
>> From what you wrote (below) I expected to see something different, maybe
>> more like the following, at least for the case with the .* not within
>> single quotes:
>> find /home/<my_username> -type d -name <dir1> <dir2> ...
>> I presume you see the same thing on your system, so I'm missing something
>> (and not ready to try a lot of experiments atm (near bedtime).
>> Any clarification will be welcomed!
>>> (for the example above). Of course you won't think of that if you
>>> are't suspecting shell expansion in the first place, but I find
>>> it very instructive to see what the shell is "seeing". That'll
>>> help memory for the next time (it does for me, at least).
>>> -- t
What directory were you in when you ran the command? If you were in
your home directory, the .* should have expanded into ". .. <and every
.file and .directory>", if you were in some other directory you might
only see the ". .." (dot dotdot).
When I ran it in my home directory, I saw everything from .ICEauthority