欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > linux >内容正文

linux

linux删除第二次出现的字符,linux下 怎样删除文件名中包含特殊字符的文件

发布时间:2023/12/4 linux 38 豆豆
生活随笔 收集整理的这篇文章主要介绍了 linux删除第二次出现的字符,linux下 怎样删除文件名中包含特殊字符的文件 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

目录中无意间出现了 -- 这个文件

[root@dev tmp]# ls

-- 00 01 02 03 04 05 06 07 08 09

[root@dev tmp]# ll

total 0

-rw-r--r-- 1 root root 0 Oct 23 15:31 --

-rw-r--r-- 1 root root 0 Oct 23 15:37 00

-rw-r--r-- 1 root root 0 Oct 23 15:37 01

-rw-r--r-- 1 root root 0 Oct 23 15:37 02

-rw-r--r-- 1 root root 0 Oct 23 15:37 03

-rw-r--r-- 1 root root 0 Oct 23 15:37 04

-rw-r--r-- 1 root root 0 Oct 23 15:37 05

-rw-r--r-- 1 root root 0 Oct 23 15:37 06

-rw-r--r-- 1 root root 0 Oct 23 15:37 07

-rw-r--r-- 1 root root 0 Oct 23 15:37 08

-rw-r--r-- 1 root root 0 Oct 23 15:37 09

怎么删都无法删除

[root@dev tmp]# rm -rf *

[root@dev tmp]# ll

total 0

-rw-r--r-- 1 root root 0 Oct 23 15:31 --

甚至是rm -rf

[root@dev tmp]# rm -rf \-\- && ll

total 0

-rw-r--r-- 1 root root 0 Oct 23 15:31 --

[root@dev tmp]# rm -rf \\-\\- && ll

total 0

-rw-r--r-- 1 root root 0 Oct 23 15:31 --

[root@dev tmp]# mv -- xx

mv: missing destination file operand after `xx'

Try `mv --help' for more information.

[root@dev tmp]# mv \-\- xx

mv: missing destination file operand after `xx'

Try `mv --help' for more information.

为什么这样的字符无法删掉、rm命令是怎么处理的?

总结

以上是生活随笔为你收集整理的linux删除第二次出现的字符,linux下 怎样删除文件名中包含特殊字符的文件的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。