我vi了一个文件,可是我没退出也没保存就按了ctrl+Z,一下子文件就没了,然后我又执行了一次vi,现在什么都没有了只有一堆我看不懂的东西,怎么办啊???
E325: ATTENTION
Found a swap file by the name ".iptables_new.sh.swp"
owned by: root dated: Tue Sep 7 10:21:18 2010
file name: /usr1/usr1/iptables/iptables_new.sh
modified: no
user name: root host name: linux
process ID: 9226 (still running)
While opening file "iptables_new.sh"
dated: Tue Sep 7 09:11:07 2010
(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 iptables_new.sh"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".iptables_new.sh.swp"
to avoid this message.
Swap file ".iptables_new.sh.swp" already exists!
Hit ENTER or type command to continue
高手帮下忙哇,小弟这里谢谢了
相思爱文 于 2010-09-07 21:58:36发表:
当vi正在编辑的文件,或非正常退出的文件。再用vi编辑时,就会显示“那一堆英文信息”。
可能用ls -a查看,是不是有隐藏的重名文件。
把隐葳文件删除就好了。
而本例中,解决方法见楼上回答
alick 于 2010-09-07 14:06:57发表:
.swp结尾的文件是vi编辑文件时建立的缓冲文件,按ctrl+Z使得当前任务中止并被
放到后台。也就是说后天仍有一个进程,是vi在编辑之前的文件,只是被停止了,并没有退出。
这时可以用fg命令把它拉回到前台,继续编辑。
但是如果这时直接想重新编辑该文件的话,由于.swp文件存在,vi会发出警告,就是楼主看到的
那一堆英文信息~~
Z天若有情H 于 2010-09-07 11:03:07发表:
{:2_105:}
Z天若有情H 于 2010-09-07 11:00:27发表:
好了,谢谢哈
Z天若有情H 于 2010-09-07 10:52:31发表:
3# shenhao0129
能说的明白点吗?我刚刚用这东西,什么都不懂,说清楚点好吗?谢谢了
shenhao0129 于 2010-09-07 10:50:19发表:
在你ctrl+Z之后,应该是把文件放到了后台运行,这个时候在终端输入fg就可以重新调出来了
Z天若有情H 于 2010-09-07 10:44:38发表:
哇,,,,没人在啊???有的高手快出来帮下忙啊