linux文件所有者和所属组问题

假设linux中有一文件text.txt 所有者为admin 所属组为admin,现在我使用chgrp命令改变该文件所属组为user,是不是意味着改变以后用户admin就属于user组了?

不是,这只是改变了文件的属性,用户属性不会更改
温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-08-12
linux的每个文件和文件夹都有它的所有者和所属的组,这样是为了控制文件或文件夹的权限(读写和操作三个权限)。
1、用ll 命令展示一个文件或文件夹的时候,你可以看到前面有是一个十位的字符串,第一个判断是文件还是文件夹,2-4这三个是所有者的读写执行权限,5-7是组内其他成员的读写执行权限,8-10是其他用户的读写执行权限。
2、改变文件或文件夹的所有者和组,方法如下:
chown -R 用户名:组名 文件 (R表示改变文件夹下所有文件的用户和组)。本回答被网友采纳
第2个回答  2018-08-20
I guess the test.txt belongs to group user and user admin (and others) . Or we can say these three have different rights to test.txt. They didn't real own the test.txt.

I think user needn't be in that group. All the users in that group have the group's authority which was showed in command "ll". And the user can be in that group or not. He is independent.
sorry for no pinyin. Here is the translation give by fanyi.baidu.com

我猜Test.txt属于组用户和用户管理(和其他)。或者我们可以说这三个有不同的权利Test.txt。他们并没有真正拥有Test.Txt。
我认为用户不必在那个群体中。该组的所有用户都具有命令“LL”中显示的组权限。用户可以在该组中。他是独立的。
相似回答