[Linux-disciples] Easy Question - Changing Permissions a list of
files
Stephen R Laniel
steve at laniels.org
Mon Nov 14 09:56:11 EST 2005
On Mon, Nov 14, 2005 at 09:50:46AM -0500, Jason Smith wrote:
> Well, for example, I didn't know you could use "*" with chmod. I am
> not sure what you call things like "*". I know in Westlaw for example
> we use "!", "*", and "%"... I am at a complete loss for vocabulary
> this morning...
What you want to call that is a 'wildcard' -- a string that
stands for another string. In particular, 'a*b' is a 'shell
wildcard'. You're likely to see two kinds of wildcards:
shell wildcards and regular expressions. Regular expressions
can be exceedingly complicated little beasties, like
(Perl-style)
(\w+)\W\1
which says "a sequence of one or more word characters
[meaning letters and underscores, I believe], followed by a
non-word character [like a space], followed by the sequence
of word characters that we started with." Which is a precise
way of saying "a repeated word." That string would match
"that that" or "and and", for instance.
The trick with Adam's example -- the "chmod [stuff] *" thing
-- is that the shell expands '*' before 'chmod' sees it. So
if you have three files -- 'a', 'b', and 'c' -- that command
expands to
chmod [stuff] a b c
which then gets handded off to the chmod command.
Anytime you're in the shell you can use '*'.
--
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20051114/c7093365/attachment.pgp
More information about the Linux-disciples
mailing list