[Linux-disciples] Easy Question - Changing Permissions a list
of files
Adam Rosi-Kessel
adam at rosi-kessel.org
Mon Nov 14 09:39:04 EST 2005
Jason Smith wrote:
> I have directory with about 25 text files in it. I want to change the
> permissions on the directory and its contents. I can change the
> permission on the directory but the contents don't change.
>
> I am sure there is a way to say "Please change the permissions to all
> the files in this directory to ugo+rwx" or some such.
chmod ugo+rwx *
??
You can also do recursive permission changing:
chmod -R ugo+rwx *
You almost certainly don't want ugo+rwx, however, in case that was a real
example. Directories are the only thing that should be executable other
than actual programs. If you want to make all directories under a particular
directory "accessible" (i.e., people can get in them and look at files, you
would do):
find ~/path_to_make_all_available -type d -exec chmod 755 '{}' ';'
find ~/path_to_make_all_available -type f -exec chmod 644 '{}' ';'
755 is equivalent to user read/write/execute, and group and other read/write
644 is equivalent to user read/write, and group and other read
If you want it to be totally open to the world:
find ~/path_to_make_all_available -type d -exec chmod 777 '{}' ';'
find ~/path_to_make_all_available -type f -exec chmod 666 '{}' ';'
These find functions would all be recursive. If you only wanted it to go one
level in, you could do something like:
find ~/path_to_make_all_available -type d -maxdepth 1 \
-exec chmod 755 '{}' ';'
find ~/path_to_make_all_available -type f -maxdepth 1 \
-exec chmod 644 '{}' ';'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20051114/755262e4/signature.pgp
More information about the Linux-disciples
mailing list