SYNOPSIS
chown
[
DESCRIPTION
chown sets the user ID to owner for the files and directories named by pathname arguments. owner can be a user name from the user database, or a numeric user ID.
If you include a group name (specify the owner followed immediately by a colon (:) and group with no intervening spaces, such as owner:group), chown also sets the group ID to group for the files and directories named.
On 10/2016/2019/11/2022/2025, you need appropriate permissions to use chown to change the ownership of a file:
- If you have "take ownership" permission (shown as WO or writeowner by lsacl), you can make yourself the owner.
- If you have "take ownership" permission and you are an administrator, you can make administrator the owner.
- If you have the SE_TAKE_OWNERSHIP_NAME privilege, you can bypass the fact that you do not have "take ownership permission", and make yourself or administrator the owner.
- If you have "restore" privilege, you can set the owner to anybody.
You can also specify owner in the form domain\user, although this may not work if you specify a domain other than your local machine domain.
When owner is the name of both a local user and the local computer. chown assigns ownership to the local user. To explicitly make the local computer the owner of a file, specify computer_name/ or computer_name\ (where computer_name is the name of the local computer) as the value of owner.
Options
-f -
does not issue an error message if chown cannot change the owner. In this case, chown always returns a status of zero. Other errors may cause a non-zero return status.
-R -
If a pathname on the command line is the name of a directory, chown changes all the files and subdirectories under that directory to belong to the specified owner (and group, if :group is specified). If chown cannot change some file or subdirectory under the directory, it continues to try to change the other files and subdirectories under the directory, but exits with a non-zero status.
DIAGNOSTICS
Possible exit status values are:
- 0
-
You specified
-f , or chown successfully changed the ownership of all the specified files and directories. - 1
-
Failure due to any of the following:
- 2
-
Failure due to any of the following:
PORTABILITY
POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022. Windows Server 2025.
The
AVAILABILITY
PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.5 Documentation Build 40.