日期:2014-05-16  浏览次数:20605 次

linux权限的问题

比方说,我建立一个文件夹 test 其权限是 777

然后用帐号a在test 下建立文件 touch a1

然后帐号a退出,切换到b帐号,也到test目录下,然后用vi a1对其编辑,然后:wq发现保存失败,提示该文件是可读性的,不能修改。但是,我用wq!就能强行保存,而且保存后,其文件a1的所有者也变为b帐号了,这让我不可理解,请解释。



------解决方案--------------------
前面不是刚有人问了一样的问题:
http://topic.csdn.net/u/20111224/19/5c06b957-f07d-4737-b80a-ef661b6b623d.html?15467
------解决方案--------------------
这没什么好解释的,vim中输入:help :w看帮助:

:w[rite]! [++opt] Like ":write", but forcefully write when 'readonly' is
set or there is another reason why writing was
refused.
Note: This may change the permission and ownership of
the file and break (symbolic) links. Add the 'W' flag
to 'cpoptions' to avoid this.