linux中一些特殊的中文文件不能删除问题

时间:2023-03-09 03:17:18
linux中一些特殊的中文文件不能删除问题

例:

[root@iZ2zecl4i8oy1rvs00dqzeZ tmp]# ls |tail -
,'双..','xx..以上xxx','出xx0元.#r用',1000.00,),(,,'
[root@iZ2zecl4i8oy1rvs00dqzeZ tmp]# echo "rm -rf `ls |tail -1 ` "
rm -rf ,'双..','xx..以上xxx','出xx0元.#r用',1000.00,),(,,'
[root@iZ2zecl4i8oy1rvs00dqzeZ tmp]# echo "rm -rf `ls |tail -1 ` " |bash
bash: line : syntax error near unexpected token `)'
bash: line : `rm -rf ,','双..','xx..以上xxx','出xx0元.#r用',1000.00,0),(1509011,241,','㞧 [root@iZ2zecl4i8oy1rvs00dqzeZ tmp]# ls -i |tail -
,'双..','xx..以上xxx','出xx0元.#r用',1000.00,),(,,'
[root@iZ2zecl4i8oy1rvs00dqzeZ tmp]# find ./ -inum -exec rm {} \;

如上,可通过ls -i 找到其inode节点,间接删除文件