[Gllug] rm -R not working on Fedora

Bruce Richardson itsbruce at uklinux.net
Fri Feb 11 21:48:27 UTC 2005


On Fri, Feb 11, 2005 at 09:34:10PM +0000, Garry wrote:
> 
> So rm -R can only be used for non-specific removals? Then how come I've used
> chmod -R with wildcards to selectively modify permissions of files within
> subdirectories, eg.
> 
> chmod -R 644 *.html

Firstly, chmod and cp are not the same binary, so why should you expect
them to behave in the same way just because you pass them the same
letter as a parameter?

Secondly, that command would not touch anything in any subdirectories
unless at least one of the directories in the current working directory
also ended in .html.  What that command line will do is expand *.html to
match the list of files and directories and then pass that to the chmod
command.

You need to read up on shell wildcard expansion and to test your
theories a bit more rigourously.

-- 
Bruce

I unfortunately do not know how to turn cheese into gold.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20050211/a3095ebc/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list