1 现象
wget 下载的时候少了个参数,导致目录下生成了几个文件名乱码的文件,直接rm 还删除不了,如下:
https://www.cndba.cn/dave/article/116460
[dave@www.cndba.cn software]# ll
total 1334372
-rwxr-xr-x 1 root root 757260288 Feb 5 16:55 dm8_20211111_x86_rh6_64_ent_8.1.2.18_pack16.iso
-rwxr-xr-x 1 root root 492317201 Feb 5 16:55 dmhs_V4.1.1_dm8_rev99696_rh6_64_veri_20210527.bin
-rw-r--r-- 1 root root 0 Feb 26 21:21 ?G??De??ۯ???C????$?P??bo?gq
drwxr-xr-x 4 omm dbgroup 4096 Feb 18 23:12 openGauss
-rw-r--r-- 1 root root 18539414 Feb 26 21:20 Oracle_VM_VirtualBox_Extension_Pack-7.0.6a-155176.vbox-extpack
-rw-r--r-- 1 root root 98268344 Feb 26 18:39 VirtualBox-7.0-7.0.6.rpm
-rw-r--r-- 1 root root 0 Feb 26 21:21 ??Ο???d?
[dave@www.cndba.cn software]# rm -rf "?G??De??ۯ???C????$?P??bo?gq"
[dave@www.cndba.cn software]# rm -rf "??Ο???d?"
[dave@www.cndba.cn software]# ll
total 1334372
-rwxr-xr-x 1 root root 757260288 Feb 5 16:55 dm8_20211111_x86_rh6_64_ent_8.1.2.18_pack16.iso
-rwxr-xr-x 1 root root 492317201 Feb 5 16:55 dmhs_V4.1.1_dm8_rev99696_rh6_64_veri_20210527.bin
-rw-r--r-- 1 root root 0 Feb 26 21:21 ?G??De??ۯ???C????$?P??bo?gq
drwxr-xr-x 4 omm dbgroup 4096 Feb 18 23:12 openGauss
-rw-r--r-- 1 root root 18539414 Feb 26 21:20 Oracle_VM_VirtualBox_Extension_Pack-7.0.6a-155176.vbox-extpack
-rw-r--r-- 1 root root 98268344 Feb 26 18:39 VirtualBox-7.0-7.0.6.rpm
-rw-r--r-- 1 root root 0 Feb 26 21:21 ??Ο???d?
[dave@www.cndba.cn software]#
2 解决方法
直接使用find 命令加inode 来删除。
获取文件inode:
https://www.cndba.cn/dave/article/116460
https://www.cndba.cn/dave/article/116460
[dave@www.cndba.cn software]# ls -il
total 1334372
2959471617 -rwxr-xr-x 1 root root 757260288 Feb 5 16:55 dm8_20211111_x86_rh6_64_ent_8.1.2.18_pack16.iso
2967554705 -rwxr-xr-x 1 root root 492317201 Feb 5 16:55 dmhs_V4.1.1_dm8_rev99696_rh6_64_veri_20210527.bin
2959471619 -rw-r--r-- 1 root root 0 Feb 26 21:21 ?G??De??ۯ???C????$?P??bo?gq
6980221487 drwxr-xr-x 4 omm dbgroup 4096 Feb 18 23:12 openGauss
2959471620 -rw-r--r-- 1 root root 18539414 Feb 26 21:20 Oracle_VM_VirtualBox_Extension_Pack-7.0.6a-155176.vbox-extpack
2959471618 -rw-r--r-- 1 root root 98268344 Feb 26 18:39 VirtualBox-7.0-7.0.6.rpm
2959471616 -rw-r--r-- 1 root root 0 Feb 26 21:21 ??Ο???d?
[dave@www.cndba.cn software]# find ./ -inum 2959471619
./?G??De??ۯ???C????$?P??bo?gq
[dave@www.cndba.cn software]# find -inum 2959471619
./?G??De??ۯ???C????$?P??bo?gq
删除文件:
https://www.cndba.cn/dave/article/116460
https://www.cndba.cn/dave/article/116460
[dave@www.cndba.cn software]# find -inum 2959471619 -delete
[dave@www.cndba.cn software]# ll
total 1334372
-rwxr-xr-x 1 root root 757260288 Feb 5 16:55 dm8_20211111_x86_rh6_64_ent_8.1.2.18_pack16.iso
-rwxr-xr-x 1 root root 492317201 Feb 5 16:55 dmhs_V4.1.1_dm8_rev99696_rh6_64_veri_20210527.bin
drwxr-xr-x 4 omm dbgroup 4096 Feb 18 23:12 openGauss
-rw-r--r-- 1 root root 18539414 Feb 26 21:20 Oracle_VM_VirtualBox_Extension_Pack-7.0.6a-155176.vbox-extpack
-rw-r--r-- 1 root root 98268344 Feb 26 18:39 VirtualBox-7.0-7.0.6.rpm
-rw-r--r-- 1 root root 0 Feb 26 21:21 ??Ο???d?
[dave@www.cndba.cn software]# find ./ -inum 2959471616 |xargs -i rm -rf {}
[dave@www.cndba.cn software]# ll
total 1334372
-rwxr-xr-x 1 root root 757260288 Feb 5 16:55 dm8_20211111_x86_rh6_64_ent_8.1.2.18_pack16.iso
-rwxr-xr-x 1 root root 492317201 Feb 5 16:55 dmhs_V4.1.1_dm8_rev99696_rh6_64_veri_20210527.bin
drwxr-xr-x 4 omm dbgroup 4096 Feb 18 23:12 openGauss
-rw-r--r-- 1 root root 18539414 Feb 26 21:20 Oracle_VM_VirtualBox_Extension_Pack-7.0.6a-155176.vbox-extpack
-rw-r--r-- 1 root root 98268344 Feb 26 18:39 VirtualBox-7.0-7.0.6.rpm
[dave@www.cndba.cn software]#