linux下删除特殊字符的文件或者目录

problem describe

在最近的操作中发现一些上传的文件有乱码,更改几次都无法正常转换到中文

problem resolve

根据inode num删除

使用 ls -i 或者 ls -inum 查找出文件id号(红色字体)
[root@localhost home]# ls -i
260615 epel-release-latest-6.noarch.rpm 273780 test.txt

[root@localhost home]# ls -inum
273780 test.txt, 260615 epel-release-latest-6.noarch.rpm
结合find命令删除
[root@localhost home]# find -inum 273780 -exec rm -rf {} \;
epel-release-latest-6.noarch.rpm
删除成功
posted @ 2022-03-11 23:39  mvpbang  阅读(498)  评论(0编辑  收藏  举报