深度阅读

How to change the group of a file in Linux?

作者
作者
2023年08月22日
更新时间
5.0 分钟
阅读时间
0
阅读量

To change the group ownership of a file in Linux, you can use the chgrp command followed by the name of the group and the file you want to modify. Here is the basic syntax:

sudo chgrp group_name file_name

For example, to change the group ownership of a file called “example.txt” to the group “admin”, you could use the following command:

sudo chgrp admin example.txt

Note that you need to have root privileges (or be a member of the sudo group) to use the chgrp command.

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。