当前位置: 技术问答>linux和unix
vi 看了很多旧帖都没有...为了这个问题,我花了一天时间问人..:(
来源: 互联网 发布时间:2014-11-18
本文导语: vi ***.cp 后 因为上一次vi的非法操作,出现这个文档变成只读 kill了所有的VI线程,还是不行(.****.cp.swp也已经删除) 用ROOT改变文件属性,也不行 我快S了................................................. 进入后按:i -->出现 Warning:...
vi ***.cp 后
因为上一次vi的非法操作,出现这个文档变成只读
kill了所有的VI线程,还是不行(.****.cp.swp也已经删除)
用ROOT改变文件属性,也不行
我快S了.................................................
进入后按:i -->出现
Warning: Changing a readonly file
然后就是 --->
Found a swap file by the name ".sendmail.cf.swp"
dated: Wed Apr 17 04:00:45 2002
owned by: root
file name: /etc/sendmail.cf
modified: YES
host name: main.showgood.com
user name: root
process ID: 25378
While opening file "sendmail.cf"
dated: Tue Feb 12 01:31:46 2002
(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r sendmail.cf"
to recover the changes (see ":help recovery)".
If you did this already, delete the swap file ".sendmail.cf.swp"
to avoid this message.
因为上一次vi的非法操作,出现这个文档变成只读
kill了所有的VI线程,还是不行(.****.cp.swp也已经删除)
用ROOT改变文件属性,也不行
我快S了.................................................
进入后按:i -->出现
Warning: Changing a readonly file
然后就是 --->
Found a swap file by the name ".sendmail.cf.swp"
dated: Wed Apr 17 04:00:45 2002
owned by: root
file name: /etc/sendmail.cf
modified: YES
host name: main.showgood.com
user name: root
process ID: 25378
While opening file "sendmail.cf"
dated: Tue Feb 12 01:31:46 2002
(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r sendmail.cf"
to recover the changes (see ":help recovery)".
If you did this already, delete the swap file ".sendmail.cf.swp"
to avoid this message.
|
将.sendmail.cf.swp文件删掉。
rm .sendmail.cf.swp
rm .sendmail.cf.swp
|
册除交换文件前要把交换文件umount下来,
也可以在单用户下执行嘛,
也可以在单用户下执行嘛,
|
用一张软盘启动的完整LINUX系统,启动后加载那个分区,编辑文件
|
我猜猜看:
你的/var/run下有一些pid结尾的文件,你看看是不是有一个
里面的数字是下面这个id:
process ID: 25378
如果有,把这个文件删掉试试。
另外,
If this is the case, use ":recover" or "vim -r sendmail.cf
你有没有试过recover?
最后,如果还是不行,把文件mv一个新名字,看看能不能编辑?
你的/var/run下有一些pid结尾的文件,你看看是不是有一个
里面的数字是下面这个id:
process ID: 25378
如果有,把这个文件删掉试试。
另外,
If this is the case, use ":recover" or "vim -r sendmail.cf
你有没有试过recover?
最后,如果还是不行,把文件mv一个新名字,看看能不能编辑?
|
重新启动机器呢?
|
用ps auxww|grep sendmail看看是不是有什么进程在用这个文件??
|
把所有可能读那个文件的进程都kill 掉。
比如sendmail,还有你刚装的,等。
比如sendmail,还有你刚装的,等。