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

Re: Recursively changes rights for directories only?



On Sun, 13 Jun 1999, Lance Hoffmeyer wrote:

 : 
 : As root I moved a directory structure.  So that any user could read/write files I recursively changed modes for 
 : all files and directories to rw (i.e. chmod 666 *).  Dumb me, eh?  I now need to recursively change all directories only 
 : to xr instead of rw.  What is an easy and quick way to do this?  I thought of using 'ls -dR' and piping 'chmod' through it:
 : 
 : ls -dR | chmod 555 * 
 : 
 : but ls -d just gives me . .. and no directory names.
 : 
 : What should I do to change these rights?

cd to the base dir where you wish to change permissions, and do

  find . -type d | xargs chmod 555

--
Nathan Norman
MidcoNet  410 South Phillips Avenue  Sioux Falls, SD
mailto:finn@midco.net           http://www.midco.net
finger finn@home.midco.net for PGP Key: (0xA33B86E9)



Reply to: