An operating system is essential to a computer. However, Linux is developing very rapidly and is catching up with Microsoft. Here we will introduce the knowledge of Linux, so that you can learn how to use Linux. Today I will talk about Linux chgrp and chown. I hope you will remember Linux chgrp and chown.
Chgrp command
Function: Change the group to which a file or directory belongs.
Syntax: chgrp [Option] group filename?
This command changes the user group to which the specified file belongs. The group can be either the user group ID or the group name of the user group in the/etc/group file. A file name is a list of files separated by spaces to change the group. Wildcards are supported. If the user is not the owner or super user of the file, the file group cannot be changed.
The options of this command are as follows:
-R recursively changes the group of all subdirectories and files in a specified directory.
Chown command
Function: Modify the owner and group of a file or directory. This command is also very common. For example, if the root user copies a file to xu, the root user should set the owner of the file to xu to allow xu to access the file. Otherwise, user xu cannot access this file.
Syntax: chown [Option] user or group file
Note: chown will change the owner of a specified file to a specified user or group. Users can be user names or user IDs. A group can be a group name or group ID. Files are separated by spaces to change the permission list. Wildcards are supported.
The options of this command are as follows:
-R recursively changes the owner of all subdirectories and files under a specified directory.
-V: displays the work done by the chown command.
I hope you can learn Linux chgrp and chown.
- Detailed introduction to the use of Linux scp
- Describe the concept of Linux Makefile
- Select your preferred Linux system Desktop
- Windows is worth the top ten features of Linux
- Use Linux to prevent hackers