Linux删除乱码文件
[ 2009/06/11 14:22 | by selboo ]
[root@selboo /]# ll
total 84
drwxr-xr-x 2 root root 4096 May 9 11:25 bin
drwxr-xr-x 2 root root 4096 Mar 30 2007 boot
drwxr-xr-x 10 root root 13160 May 30 02:17 dev
drwxr-xr-x 18 root root 4096 May 8 02:46 eaccelerator_cache
drwxr-xr-x 37 root root 4096 May 30 02:17 etc
drwxr-xr-x 6 root root 4096 May 23 17:10 home
drwxr-xr-x 9 root root 4096 May 8 00:49 lib
drwx------ 2 root root 16384 Jul 9 2008 lost+found
drwxr-xr-x 2 root root 4096 Mar 30 2007 media
drwxr-xr-x 3 root root 4096 Mar 30 2007 mnt
drwxr-xr-x 3 root root 4096 May 16 18:36 opt
dr-xr-xr-x 47 root root 0 May 30 02:17 proc
drwxr-x--- 4 root root 4096 Jun 9 10:07 root
drwxr-xr-x 2 root root 4096 May 8 00:48 sbin
drwxr-xr-x 2 root root 4096 Mar 30 2007 selinux
drwxr-xr-x 2 root root 4096 Mar 30 2007 srv
drwxr-xr-x 11 root root 0 May 30 02:17 sys
drwxrwxrwt 5 root root 4096 Jun 11 13:44 tmp
drwxr-xr-x 13 root root 4096 Jul 9 2008 usr
drwxr-xr-x 17 root root 4096 Jul 9 2008 var
drwxr-xr-x 5 root root 4096 May 23 22:56 wwwroot
-rw-r--r-- 1 root root 0 May 23 22:38 ?Os???j?
上面的红色文件,我们无法用键盘输入,所以也无法删除
可以使用 索引节点(i节点) 进行删除
[root@selboo /]# ll -i
51665 -rw-r--r-- 1 root root 0 May 23 22:38 ?Os???j?
得到i节点为 5166551665 -rw-r--r-- 1 root root 0 May 23 22:38 ?Os???j?
通过find命令删除i节点为51665的文件
[root@selboo /]# find ./ -inum 51665 -print -exec rm {} -rf \;
./?Os???j?
./?Os???j?
最后编辑: selboo 编辑于2012/03/29 23:40