[Gllug] How to chmod selectively without writing a script

John Hearns john.hearns at cern.ch
Tue Oct 1 15:12:14 UTC 2002


On Tue, 2002-10-01 at 17:07, Garry Heaton wrote:
> Thanks, Tet
> 
> Can you explain why
> 
> chmod -R 755 */
> 
> ... changes files as well as directories. I couldn't find anything in
> "Linux Desk Reference" (Scott Hawkins) to explain the "{} \" in the
> solutions you offered. They work fine, of course, but I need to
> understand what's going on.

I had to use find like this only the other day
(in actual fact to remove all AFS cache files like .__afsxxxx )

Look in the man page for 'find'
The {} is replaced by the current filename which find has found for
you - ie. every time find gets a file it runs the command, substituting
{} for the filename it has.

the \; ends the command - but the space is important.
I (ahem) forgot this and had a few minutes of panic till I read
the man page.



-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list