Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the chgrp command in Linux

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Xiaobian to share with you how to use the chgrp command in Linux, I believe most people still do not know how to use it, so share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!

The Linux command chgrp is used to change the user group to which a file or directory belongs. This command is used to change the user group to which the specified file belongs. The group name may be the ID or group name of the user group.

chgrp is used to change the group to which a file or directory belongs

In the UNIX family, control of file or directory permissions is managed by owner and group. You can use chgrp to change the group to which files and directories belong, either by group name or group ID.

syntax chgrp [options][groups][files| Directory] option-R recursively changes the group to which the specified directory and all its subdirectories and files belong-c or--changes: effects similar to the "-v" parameter, but only reports changes; -f or--quiet or--silent: no error message is displayed; -h or--no-dereference: changes only symbolically connected files, not any other related files;-H If the command line argument is a symbolic link to the directory, traverse symbolic links-R or--recursive: recursive processing, all files and subdirectories under the instruction directory are processed together; -L traverse every symbolic link to the directory encountered-P does not traverse any symbolic links (default)-v or--verbose: show instruction execution; --reference=: Set all the groups to which a specified file or directory belongs to the same group as the reference file or directory; parameter group: Specify the new job name;

Files: Specifies the list of files to which you want to change the group to which you belong. Multiple files or directories are separated by spaces.

instance Change the user group for all files in/usr/meng and its subdirectories to mengxin

chgrp -R mengxin /usr/meng Change the group owner of file ah to newuser

[root@rhel ~]# chgrp newuser ah The above is "How to use chgrp command in Linux" All the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report