16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Exit Values<br />

0 Successful completion<br />

Related Information<br />

mount, unmount<br />

chown — Change the owner or group of a file or directory<br />

Format<br />

Description<br />

Options<br />

chown [–fhR] owner[:group] pathname ...<br />

chmount<br />

chown sets the user ID (UID) to owner for the files and directories named by<br />

pathname arguments. owner can be a user name from the user data base, or it can<br />

be a numeric user ID. (If a numeric owner exists as a user name in the user data<br />

base, the user ID number associated with that user name is used.) If there is no<br />

change to the UID, then specify – – –1.<br />

If you include a group name (that is, if you specify owner followed immediately by a<br />

colon (:) and then group with no intervening spaces, such as owner:group) chown<br />

also sets the group ID (GID) to group for the files and directories named. group can<br />

be a group name from the security facility group data base, or it can be a numeric<br />

group ID. If a numeric group exists as a group name in the group data base, the<br />

group ID number associated with that group is used. If there is no change to the<br />

GID, then specify –1 (or do not specify the :group).<br />

Note: Only a superuser can change the UID. To change the GID, you must either<br />

be a superuser, or the effective user ID of the process must be equal to the<br />

user ID of the file owner, and the owner argument is also equal to the user<br />

ID of the file owner or –1, and the group argument is the calling process’s<br />

effective group ID or one of its supplementary group IDs.<br />

chown also turns off the set-user-ID bit and set-group -ID bit of the named files and<br />

directories.<br />

–f Does not issue an error message if chown cannot change the owner. In<br />

this case, chown always returns a status of zero. Other errors may cause a<br />

nonzero return status.<br />

–h Does not attempt to follow the symbolic link (or external link), but instead<br />

makes the changes on the symbolic link (or external link) itself.<br />

–R If pathname on the command line is the name of a directory, chown<br />

changes all the files and subdirectories in that directory to belong to the<br />

specified owner (and group, if :group is specified).<br />

If a symbolic link is specified or encountered during the traversal of a file<br />

hierarchy, chown changes the directory referenced by the symbolic link and<br />

all files in the file hierarchy below it.<br />

If chown cannot change some file or subdirectory in the directory, it<br />

continues to try to change the other files and subdirectories in the directory,<br />

but exits with a nonzero status.<br />

Chapter 2. Shell command descriptions 129

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!