Re: Permission change - recursive
On Sat, Mar 13, 2004 at 09:46:06AM -0800, Curtis Vaughan wrote:
> I just noticed that for an entire directory of files and folders, the
> permissions are not really right.
>
> Or maybe it doesn't matter. I went ahead and changed all permission
> recursively, but feel that permissions should be as follows: for all
> files 660, whereas for all directories 770. Has anyone written a
> script that will drill through a directory and change all the
> permissions in such a manner?
There are recursive options to chmod, but I prefer using find to do this
sort of thing, e.g.,
$ find some_dir -type d -exec echo chmod 0770 {} \;
$ find some_dir -type f -exec echo chmod 0660 {} \;
The echo is there so that the actions can be inspected before actually
doing them.
Ken
--
Ken Irving
Water and Environmental Research Center
Institute of Northern Engineering
University of Alaska, Fairbanks
Reply to: