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

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



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, May 03, 2017 at 10:45:30PM -0700, Bob McGowan wrote:

[...]

> >>> 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 .*
> >>
> >> and
> >>
> >> echo find /home/<my_username> -type d -name '.*'
> >>
> >> and, in both cases, I got the same result:
> >>
> >> find /home/<my_username> -type d -name .*

[...]

> 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
> to .xsession-errors.

Exactly. Try again in a directory with something in it, and you'll
appreciate the whole power/curse of the thing :-)

The shell takes a lot from the "ambient" (current directory, shell
variables inherited through the dynamic path, etc.) and this makes
for an incredibly concise language, but is an opportunity for incredibly
clever bugs.

Learning shell means developing some feeling for this ambient.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlkK13oACgkQBcgs9XrR2kaAIACcCB+8K4hlMWKVA9IMJ0kgCXuI
Dy4An2r9ZyvnBw1mPjdter4PHdBMMS/w
=DvIH
-----END PGP SIGNATURE-----


Reply to: