vim保存文件遇到的一些问题

 You try to write your file, but you get one of the following messages:
1.File exists
   File file exists - use w!
   [Existing file]
   File is read only
 Type :w! file to overwrite the existing file, or type :w newfile to save the edited
version in a new file.
2.You want to write a file, but you don’t have write permission for it. You get the message
“Permission denied.”
Use :w newfile to write out the buffer into a new file. If you have write permission
for the directory, you can use mv to replace the original version with your copy of
it. If you don’t have write permission for the directory, type :w pathname/file to
write out the buffer to a directory in which you do have write permission (such as
your home directory, or /tmp).
 
3.You try to write your file, but you get a message telling you that the file system is full.
Type :!rm junkfile to delete a (large) unneeded file and free some space. (Starting
an ex command with an exclamation point gives you access to Unix.)
Or type :!df to see whether there’s any space on another file system. If there is,
choose a directory on that file system and write your file to it with :w pathname.
(df is the Unix command to check a disk’s free space.)
4.  The system puts you into open mode and tells you that the file system is full.
The disk with vi’s temporary files is filled up. Type :!ls /tmp to see whether there
are any files you can remove to gain some disk space.# If there are, create a tem-
porary Unix shell from which you can remove files or issue other Unix commands.
You can create a shell by typing :sh; type CTRL-D or exit to terminate the shell
and return to vi. (On modern Unix systems, when using a job-control shell, you
can simply type CTRL-Z to suspend vi and return to the Unix prompt; type fg to
return to vi.) Once you’ve freed up some space, write your file with :w!.
5. You try to write your file, but you get a message telling you that your disk quota has
been reached.
    Try to force the system to save your buffer with the ex command :pre (short
for :preserve). If that doesn’t work, look for some files to remove. Use :sh (or
CTRL-Z if you are using a job-control system) to move out of vi and remove files.
Use CTRL-D (or fg) to return to vi when you’re done. Then write your file
with :w!.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Dreamer who

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值