事件:有时候linux中不知道怎么就会有乱码的文件,文件名不是正常的英文,而是???,有强迫症的我必须删掉~~
解决过程:先根据ID 找出文件,然后删除
显示文件id命令:
ls -i
删除命令:
find . -inum 927118 |xargs rm -rf
注:上面的927118 是id
例子:
[root@hadoop ~]# ls
????? anaconda-ks.cfg install.log
[root@hadoop ~]# ls -i
927118 ????? 927048 anaconda-ks.cfg 912131 install.log
使用: find . -inum 927118 找到特殊符号的文件
[root@hadoop ~]# find . -inum 927118
./?????
执行删除
[root@hadoop ~]# find . -inum 927118 |xargs rm -rf
[root@hadoop ~]# ls
anaconda-ks.cfg install.log
[root@hadoop ~]#
完美删除!!!!
参考文章:原文链接