Monday, 15 August 2011

chmod

 

command explanation
chmod a+r file read is added for all
chmod a-x file execute permission is removed for all
chmod a+rw file change the permissions of the file file to read and write for all.
chmod +rwx file On some UNIX platforms such as BSD, this will restore the permission of the file file to default: -rwxr-xr-x.
chmod u=rw,go= file read and write is set for the owner, all permissions are cleared for the group and others
chmod -R u+w,go-w docs change 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 file removes all privileges for all
chmod 777 file change the permissions of the file file to read, write, and execute for all.
chmod 664 file sets read and write and no execution access for the owner and group, and read, no write, no execute for all others.
chmod 0755 file equivalent to u=rwx (4+2+1),go=rx (4+1 & 4+1). The 0 specifies no special modes.
chmod 4755 file the 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 directory set a directory tree to rwx for owner directories, rw for owner files, --- for group and others.
chmod -R a-x+X directory remove the execute permission on all files in a directory tree, while allowing for directory browsing.

[edit]

No comments:

Post a Comment