Command chmod

This command is part of the posix extensions and needs to be imported to be available to the shell.
See Posix Commands


chmod change file permissions


chmod [options] mode[,mode ...] file [file ...]


-R,-recurse apply mode changes recursively


The "mode" string specifies the changes to be made to the file permissions. Each file permissions (and if -R is specified all decendant files) are modified according to the mode string. The mode string takes the form [uoa][+-=][rwx]

The first part of the mode string can be any combination of "u" for user, "o" for others or "a" for all.
The next part is either a +, -, or = meaning "add the permssions" , "remove the permissions" or "set the permissions".
The final part can be any combination of "r" for read, "w" for write and "x" for execute.
Multiple operations can be separated by a "," e.g.


chmod a+w,u+r file

Return Value

Returns 0 if the command executed successfully, 1 if there was an error.

There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki