Linux chown is a command that changes the owner of a specified file to a specified user or group. The syntax of the command is "chown [-cfhvR] [--help] [--version] user[:group ] file...", its parameter "user" represents the user ID of the new file owner.
Linux/Unix is a multi-person, multi-tasking operating system, and all files have owners. Use chown to change the owner of the specified file to the specified user or group. The user can be the user name or user ID; the group can be the group name or group ID; the file is a space-separated list of files whose permissions need to be changed, and wildcards are supported.
Generally speaking, the chown command can only be used by the system administrator (root). Generally, users do not have permission to change other people’s file owners, nor do they have permission to change their own file owners. Set to someone else. Only the system administrator (root) has such permissions.
Permissions: root
Syntax
chown [-cfhvR] [--help] [--version] user[:group] file...
Parameters:
user: The user ID of the new file owner
group: The user group (group) of the new file owner
-c: Display the changed part of the information
-f: Ignore error messages
-h: Repair symbolic links
-v: Display detailed processing information
-R: Process the specified directory and its subdirectories All files under
--help: Display auxiliary instructions
--version: Display version
Instance
Replace the file The owner of file1.txt is set to runoob, the group user runoobgroup:
chown runoob:runoobgroup file1.txt
Set the owner of all files and subdirectories in the current directory to runoob, the group user runoobgroup:
chown -R runoob:runoobgroup *
The above is the detailed content of What does linux chown mean?. For more information, please follow other related articles on the PHP Chinese website!