Chmod

From Wsms

Jump to: navigation, search

Note: This page should be titled chmod (all lowercase). It is Chmod due to technical limitations of Mediawiki.

chmod changes the permissions fo files and directories

Contents

Common Usage

Set executable permission on b.pl for user, group and other.

[ggeller@arthur ~]$ chmod +x b.pl

Set the permissions of all files and directories in the current default directory to 600 (rw------, i.e. read and write for only the user).

[ggeller@arthur ~]$ chmod 600 *

Recursively set the user write bit on testdir and all the files and directories it contains.

[ggeller@arthur ~]$ chmod -R u+w testdir/

Recursively set the user read bit on testdir and all the files and directories it contains.

[ggeller@arthur ~]$ chmod -R u+r testdir/

Open Questions

If you have an upload directory, is there a way to make the files belong to you (the owner of the directory) instead of the user that uploaded it (usually apache)? Set permissions for an upload directory

[georgeg@rop ~]$ chmod g+s uploads/

Tips

see also

man chmod

Personal tools