Friday, March 18, 2011

chmod Command


chmod a+r fileread is added for all
chmod a-x fileexecute permission is removed for all
chmod a+rw filechange the permissions of the file file to read and write for all.
chmod +rwx fileOn some UNIX platforms such as BSD, this will restore the permission of the file file to default: -rwxr-xr-x.
chmod u=rw,go= fileread and write is set for the owner, all permissions are cleared for the group and others
chmod -R u+w,go-w docschange the permissions of the directory docs and all its contents to add write access for the user, and deny write access for everybody else.
chmod fileremoves all privileges for all
chmod 777 filechange the permissions of the file file to read, write, and execute for all.
chmod 664 filesets read and write and no execution access for the owner and group, and read, no write, no execute for all others.
chmod 0755 fileequivalent to u=rwx (4+2+1),go=rx (4+1 & 4+1). The 0 specifies no special modes.
chmod 4755 filethe 4 specifies set user ID and the rest is equivalent to u=rwx (4+2+1),go=rx (4+1 & 4+1).
chmod -R u+rwX,g-rwx,o-rwx directoryset a directory tree to rwx for owner directories, rw for owner files, --- for group and others.
chmod -R a-x+X directoryremove the execute permission on all files in a directory tree, while allowing for directory browsing.

No comments:

Post a Comment