关于Linux下文件删除文件时提示No such file or directory

尊敬的各位老大:

本人了Linux小白一枚,遇到一点问题想请老大们指点一下
今天练习tar命令压缩文件时想给给文件名内增加一个当前年月日

[root@poker log]# tar zcvf log.tar-'date +%F'.gz .

结果把反引号写成单引号
用 ls 命令查看发现压缩后的文件名为

log.tardate +%F.gz

意识到自己的错误之后想删除这个文件
结果出现

[root@poker log]# rm ./log.tar-date +%F.gz

rm: cannot remove ./log.tar-date': No such file or directory<br/>rm: cannot remove+%F.gz': No such file or directory

想移动到别处也出现一样的提示

find . -name "*.gz"|xargs mv -t /tmp

mv: cannot stat ./log.tar-date': No such file or directory<br/>mv: cannot stat+%F.gz': No such file or directory

几经周折.....此处省略一万个字
后来想到是不是可以用inode号删除
于是首先查看这个文件的 inode号

[root@poker log]# ls -lhi .
267015 -rw-r--r-- 1 root root 373K Sep 9 16:33 log.tardate +%F.gz

然后尝试

[root@poker log]# find . -inum 267015 -delete

ls 查看,结果这个文件真的没有了

请问为啥会出现这种情况呢

                                                此致,敬礼
                                                                            来自一位Linux小白的渴求

猜你喜欢

转载自blog.51cto.com/13921547/2172901