man Pages(1): User Commands
この本のみを検索
PDF 文書ファイルをダウンロードする

NAME

chown - change owner of file

SYNOPSIS

chown [ -fhR ] owner filename . . .

AVAILABILITY

SUNWcsu

DESCRIPTION

chown changes the owner of the files to owner. The owner may be either a decimal user ID or a login name found in /etc/passwd file.
If chown is invoked by other than the super-user, the set-user-ID bit of the file mode, 04000, is cleared.
Only the owner of a file (or the super-user) may change the owner of that file.
The operating system has a configuration option {_POSIX_CHOWN_RESTRICTED },to restrict ownership changes. When this option is in effect the owner of the file is prevented from changing the owner ID of the file. Only the super-user can arbitrarily change owner IDs whether this option is in effect or not.

OPTIONS

-f
Do not report errors.
-h
If the file is a symbolic link, change the owner of the symbolic link. Without this option, the owner of the file referenced by the symbolic link is changed.
-R
Recursive. chown descends through the directory, and any subdirectories, setting the ownership ID as it proceeds. When a symbolic link is encountered, the owner of the target file is changed (unless the -h option is specified), but no recursion takes place.

ENVIRONMENT

If any of the LC_ *variables ( LC_CTYPE, LC_MESSAGES, LC_TIME, LC_COLLATE, LC_NUMERIC, and LC_MONETARY ) (see environ(5)) are not set in the environment, the operational behavior of chown for each corresponding locale category is determined by the value of the LANG environment variable. If LC_ALL is set, its contents are used to override both the LANG and the other LC_ *variables. If none of the above variables is set in the environment, the "C" (U.S. style) locale determines how chown behaves.
LC_CTYPE
Determines how chown handles characters. When LC_CTYPE is set to a valid value, chown can display and handle text and filenames containing valid characters for that locale. chown can display and handle Extended Unix Code (EUC) characters where any individual character can be 1, 2, or 3 bytes wide. chown can also handle EUC characters of 1, 2, or more column widths. In the "C" locale, only characters from ISO 8859-1 are valid.
LC_MESSAGES
Determines how diagnostic and informative messages are presented. This includes the language and style of the messages, and the correct form of affirmative and negative responses. In the "C" locale, the messages are presented in the default form found in the program itself (in most cases, U.S. English).

FILES

/etc/passwd

SEE ALSO

chgrp(1), chmod(1), chown(2), passwd(4), environ(5)