vim保存文件遇到的一些问题
2015-01-17 21:59
483 查看
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!.
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!.
相关文章推荐
- vi / vim保存文件时遇到的问题:E212: Can't open file for writing
- gridview保存Excel文件遇到的问题
- vim 的配置过程中遇到的一些问题
- 关于模型数组进行本地保存中遇到的一些问题
- 记2416移植2.6.36内核和yaffs根文件系统时遇到的一些问题
- mysql 直接拷贝data 目录下文件 进行数据库迁移时遇到的一些问题??
- [完]PHP文件下载 下载GET值中含有中文字符的文件,保存中文文件名,文件不能打开,遇到的编码问题
- matlab保存图片的四种方法&&遇到的一些问题
- 今天在Mac机器上使用了Flex Builder编辑了一个源代码文件,保存后使用vim命令去打开时发现系统自动在每一行的结尾添加了^M符号,其实^M在Linux/Unix中是非常常见的,也就是我们在Win中见过的/r回车符号。由于编辑软件的编码问题,某些IDE的编辑器在编辑完文件之后会自动加上这个^M符号。看起来对我们的源代码没有任何影响,其实并不然,当我们把源代码文件Check In到svn之类
- vim配置中遇到的一些问题
- 给树莓派2的vim安装powerline时遇到的一些小问题和解决方法
- Linux C 文件传输程序(TCP && UDP) 遇到的一些问题
- vi 新建文件保存文件时遇到的问题:E212: Can't open file for writing
- 关于 c# 操作 Excel文件中遇到的保存出错问题
- 关于vim的一些使用以及Dos文件到Linux、Mac下问题
- spark:学习过程中遇到的一些问题及解决方法(如何将本地文件发布到HDFS)--11
- Ubuntu下配置Sublime到Dash board 以及 VI/VIM编辑文件时无权限保存的问题
- 用eclipse配置hibernate的hbm.xml文件时遇到的一些问题
- python 3读网页文件及保存成本地文件,遇到的编码问题
- 编译lua5.3扩展.so文件时遇到的一些问题总结