[Techtalk] In Search Of A Script to Change Attributes Of Files

Cynthia Kiser cnk at ugcs.caltech.edu
Sun Nov 30 21:24:00 EST 2003


Quoting Kathy Wills <kathywills at kathywillsfamily.com>:
> Isabelle Hurbain wrote:
> 
> >>I made a mistake in the way I backed up my files before I wiped my 
> >>hard-drive to do a clean install. I have a large number of files in
> >>two different directories that are now marked as read only when they
> >>need to be read-write. 

I generally don't want the same permissions for files as directories
so I often do something like the following to change permissions only
on the files: 

find . -type f -print | xargs chmod 664 {} \;

That will start from the current directory and change all of the files
to have permissions of rw-rw-r--. 

I then often change all the directory permissions as follows: 

find . -type d -print | xargs chmod 775 {} \;

-- 
Cynthia N. Kiser
cnk at ugcs.caltech.edu

Contrary to popular belief, Unix is user friendly. It just happens to
be very selective about who it decides to make friends with. 

	Anonymous


More information about the Techtalk mailing list