What does linux chown mean?

藏色散人
Release: 2020-09-18 09:43:23
Original
6708 people have browsed it

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.

What does linux chown mean?

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...
Copy after login

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
Copy after login

Set the owner of all files and subdirectories in the current directory to runoob, the group user runoobgroup:

chown -R runoob:runoobgroup *
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template