HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)
c
chown(1) chown(1)
effect, being superseded by the file’s
user::perm and/or group::perm entries.
Options
chown and chgrp recognize the following options:
-h Change the owner or group of a symbolic link.
By default, the owner or group of the target file that a symbolic link points to is changed.
With -h, the target file that the symbolic link points to is not affected. If the target file is a
directory, and you specify -h and -R
, recursion does not take place.
-R Recursively change the owner or group. For each file operand that names a directory, the
owner or group of the directory and all files and subdirectories in the file hierarchy below it
are changed.
EXTERNAL INFLUENCES
Environment Variables
LC_MESSAGES determines the language in which messages are displayed.
If LC_MESSAGES is not specified in the environment or is set to the empty string, the value of
LANG is
used as a default for each unspecified or empty variable. If
LANG is not specified or is set to the empty
string, a default of "C" (see lang(5)) is used instead of
LANG.
If any internationalization variable contains an invalid setting,
chown behaves as if all internationalization
variables are set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
chown and chgrp return the following values:
0 Successful completion.
>0 An error condition occurred.
EXAMPLES
The following command changes the owner of the file jokes to sandi:
chown sandi jokes
The following command searches the directory design_notes and changes each file in that directory to
owner mark and group users:
chown -R mark:users design_notes
WARNINGS
The default operation of chown and chgrp for symbolic links has changed as of HP-UX release 10.0. Use
the -h option to get the former default operation.
FILES
/etc/group
/etc/passwd
SEE ALSO
chmod(1), setprivgrp(1M), chown(2), group(4), passwd(4), acl(5), aclv(5).
STANDARDS CONFORMANCE
chown: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
chgrp: SVID2, SVID3, XPG2, XPG3, XPG4, POSIX.2
132 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: February 2007