Linux如何删除一些乱码命名的文件

来源:互联网 发布:淘宝网1元秒杀专区 编辑:程序博客网 时间:2024/06/06 05:19

工作中碰到几次类似问题,现总结下解决方案,以备后用:

$ ls
??????????_??????b6?S??.a  test.war.bk  test.war.bk1  ??z?2??F?
[test@testPC /home/test]
$ ls -liaha
total 11M
397163 drwxr-xr-x 3 deploy deploy 4.0K May  8 09:09 .
397160 drwxr-xr-x 4 root   root   4.0K May 23  2014 ..
398445 -rw-rw-r-- 1 test  test0 May  8 09:09 ??????????_??????b6?S??.a
398357 -rw-r--r-- 1 test  test  5.4M May  5 11:05 test.war.bk
397113 -rw-r--r-- 1 test  test   5.4M May  8 09:08 test.war.bk1
397034 -rw-rw-r-- 1 test  test  0 May  8 09:09 ??z?2??F?
[test@testPC/var/www/webapps]
$ find . -inum 398445 -exec rm {} -rf \;
                                                        ==》 Comment: 通过索引结点号找到文件并删除


0 0