Chown can change the owner and group commands of files or directories on disks to facilitate permission control for users. Chown [Syntax] chown [options] [Parameters] [details] the chown command is used to change the owner or group of a specified file or directory. When changing the file owner or group, you can use the user name and user ID settings. [Parameter] option function
Chown can change the owner and group commands of files or directories on disks to facilitate permission control for users.
Chown
[Syntax]Chown [option] [parameter]
[Details]The chown command is used to change the owner or group of a specified file or directory. When changing the file owner or group, you can use the user name and user ID settings.
[Parameters]
| Option |
Functions |
| -C |
Results are displayed only when changes are made. |
| Changes |
Same as-c. |
| -- Dereference |
Modify the object indicated by the symbolic link. do not change the symbolic connection itself. |
| -F |
No error message is displayed. |
| -- Quiet |
Same as-f. |
| -- Silent |
Same as-f. |
| -H |
Only modify the file of the symbolic link. do not modify the object indicated by the symbolic link. |
| -R |
Process all files in the specified directory and subdirectory. |
| -V |
Displays the detailed process after the command is processed. |
| -- Help |
Displays help information. |
| -- Version |
Displays version information. |
[Description]
| Keywords |
Introduction |
| Owner |
Change the owner name of a file or directory. |
| Group |
Name of the new group to which the file or directory belongs. |
| File |
Specifies the name of the file to be changed. |
Example
Modify the owner and Group of the relevant files in conjunction with the Lnmp one-click installation package.
For example, modify the owner of all files in/home/wwwroot/to www, and the group to which the files belong is also www.
Then:
Cd/home/wwwroot # enter the chown-R www: www * #-R directory to recursively process all files and folders. the first www is the name of the file owner, the second www is the group. # "*" Indicates all files and folders