Sometimes, the RZ upload file failed or accidentally input command will produce garbled file name. Since the deletion of special characters with RM is basically invalid, the following two easy-to-use methods have been found:
Example:
[Email protected]:~]$ ls
?? ?? B?? G????? e#? Allium chinense? T
? 7?%?? S?^d?? X??? b timestamp falcon-agent-5.1.0.tar.gz
1.RM command
RM./*
Because the RM command will be asked before deleting the file, we can use RM Inquiry mechanism to delete garbled files.
Confirm that you want to delete the garbled file enter Y, and other reply N. The period can be ended with CTRL + C at any time
[Email protected]:~]$ rm./*
Rm:remove regular file './\245\373b\253\272g\224\257\374\346\370e#\245 Allium chinense \277t ko\376\335\322\332k%\325m~p\347jbs\ 364]\245\345b#\250\311[\203m\376\320y\372\375lzn.\3227 '? y
Rm:remove regular file './falcon-agent-5.1.0.tar.gz '? N
Rm:remove regular empty file './m\277m\233\260+\263bo '? Y
Rm:remove regular file './yc_linkd-nmob_2.6_ex_ctl-64.tar.gz '? N
Note: Make sure the RM command is not Alais into RM-RF first
2. Locate the index node to delete (Inode)
Find./-inum 54263996-exec rm {}-RF \;
[[Email protected]:~]$ Ls-li
Total 11420
6176785-rw-rw-r--1 Langxiaowei langxiaowei 0 Oct 13 17:26? 7?%?? S?^d?? X??? b Timestamp
6176784-rw-rw-r--1 Langxiaowei langxiaowei Oct 13 17:26?? B?? G????? e#? Allium chinense? T ko???? K%?m~p? JbS?]?? b#?? [? m?? Y?? Lzn.? 7
6176782-rw-r--r--1 Langxiaowei langxiaowei 3203523 10:02 falcon-agent-5.1.0.tar.gz
6176787-rw-rw-r--1 langxiaowei langxiaowei 0 Oct 14:15 m?m?? +?bo
[Email protected]:~]$ Find/-inum 6176785-exec rm-rf {} \;
This deletes the corresponding file by deleting the Inode
Linux Delete garbled file name or directory name