Re: confusing behaviour of the * wildcard when handling "dot" files and dirs.
- From: Unruh <unruh-spam@xxxxxxxxxxxxxx>
- Date: Wed, 30 Jul 2008 01:05:23 GMT
Rahul <nospam@xxxxxxxxxxxxxx> writes:
I tried going to /home/foouser/ and then doing a 'chown -R foouser *'
It seems to change the ownership recursively for all dirs and files under
/home/foouser/ except those starting with a . (dot)
Is this behaviour of the * wildcard by design or am I just missing
something here? I'm confused!
By design. * does NOT capture files which start with a . on purpose. Those
are supposed to be hidden, and thus echo * is not supposed to display them.
Since * is expanded by the shell not the program, it has to be consistant.
To get the . files, do
ls .??*
If you do just .* or .?* you will capture in the first instance both . and
... as well and if you do .?* you will capture .. This is pretty dangerous
if you are doing
rpm -r .*
for example.
Remember to always do
..??* as the wildcard for . files.
--.
Rahul
- Follow-Ups:
- Re: confusing behaviour of the * wildcard when handling "dot" files and dirs.
- From: Robert Heller
- Re: confusing behaviour of the * wildcard when handling "dot" files and dirs.
- References:
- Prev by Date: Re: confusing behaviour of the * wildcard when handling "dot" files and dirs.
- Next by Date: Re: confusing behaviour of the * wildcard when handling "dot" files and dirs.
- Previous by thread: Re: confusing behaviour of the * wildcard when handling "dot" files and dirs.
- Next by thread: Re: confusing behaviour of the * wildcard when handling "dot" files and dirs.
- Index(es):
Relevant Pages
|