linux下删除乱码文件名的文件

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/dqchouyang/article/details/79277895

怎么产生的乱码名的文件:我在向服务器上传(SecureCRT工具)文件的时候,上传一半,网络问题,导致服务器上多出来一大堆的乱码名称的文件,

-rw-r--r--  1 root  root     0 Feb  6 18:17 ?E?
-rw-r--r--  1 root  root     0 Feb  6 18:17 ~?.EZ??:?f?6Y=??t?+?X???G???S
-rw-r--r--  1 root  root     0 Feb  6 18:17 ?Fj??}??ocmj
-rw-r--r--  1 root  root     0 Feb  6 18:15 ????Э??f{????Xd
-rw-r--r--  1 root  root     0 Feb  6 18:17 g??b??3????1??U?O?xH<#??>?? ;?T?eg]??rH-??O录?]???^,}?1D????W?:?-????K?I
-rw-r--r--  1 root  root     0 Feb  6 18:17 ?g?{??M?
-rw-r--r--  1 root  root     0 Feb  6 18:17 ??mtt?????BJ
-rw-r--r--  1 root  root     0 Feb  6 18:15 G?O?
-rw-r--r--  1 root  root     0 Feb  6 18:17 h?[
-rw-r--r--  1 root  root     0 Feb  6 18:17 ?H*GZ?

这些文件中,有的可以通过 rm -f filename 去删除掉,但是还有一些文件是删不掉的,所以我们要找到这些文件在磁盘上的存储编号,然后根据这个编号就能删除了。

[root@YZ servers]# ls -i  # 查看文件的存储编号
2234683 ??
2234704 ????
2234663 ???2?G_????
2234660 2qX?????
2234692 ?3?QxE^?9?G?w
2234702 ?锝犊?4???X*V3?j??H??
2234700 ??4?毓_=ZG?郦J?.?????
2234673 ??=55
2234688 9???1???Pw???}??x??t^Le????+]??~?OL??m?}?????P2??q?茂t^?
2234706 ?^?A??{?e
2233184 app

执行下面的命令,就可以删除了

find -inum 2234683 -delete

猜你喜欢

转载自blog.csdn.net/dqchouyang/article/details/79277895
今日推荐