当前位置: 技术问答>linux和unix
linux权限的问题
来源: 互联网 发布时间:2017-01-27
本文导语: 比方说,我建立一个文件夹 test 其权限是 777 然后用帐号a在test 下建立文件 touch a1 然后帐号a退出,切换到b帐号,也到test目录下,然后用vi a1对其编辑,然后:wq发现保存失败,提示该文件是可读性的,不能修改。但是,...
比方说,我建立一个文件夹 test 其权限是 777
然后用帐号a在test 下建立文件 touch a1
然后帐号a退出,切换到b帐号,也到test目录下,然后用vi a1对其编辑,然后:wq发现保存失败,提示该文件是可读性的,不能修改。但是,我用wq!就能强行保存,而且保存后,其文件a1的所有者也变为b帐号了,这让我不可理解,请解释。
|
|
这没什么好解释的,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.
: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.