vi在使用:set backup的时候,家目录下可以保存~结尾的备份文件,在tmp目录下则不行?
#touch /root/1.txt
#vi /root/1.txt
// vi打开文件后,设置backup
:set backup
// 进入插入模式,输入一些内容
// wq保存退出
:wq
// 能找到~结尾的备份文件
#ls /root/
以上的同样过程,在/tmp目录下却无法生成~结尾的备份文件,为什么?
是/tmp这个目录很特殊吗,还是vi或vim把备份文件的保存目录排除掉/tmp目录的?
Look at
:set backupskip
, the/tmp
directory is ignored.Insufficient user rights
I don’t understand why I answered the wrong question?
touch in
/root
Is this the so-called home directory?At least under ubuntu sudo vim can be saved to the /root folder