编辑:我完全忘了这个帖子.事实证明我的硬盘坏了.我们不得不重新部署这台服务器以满足其他需求,所以我终于找到了更换一个坏磁盘而我们又回来了.
几个星期以来,我无法弄清楚为什么我无法删除这个特定文件.
作为root我可以,但我的shell脚本作为不同的用户运行.所以我去运行ls -la并且它不在那里.但是,如果我将其称为参数,它会显示出来!果然,所有者是root,因此我无法删除.
注意,6535丢失了……
[root@server]# ls -la 653* -rw-rw-r-- 1 svn svn 24002 Mar 26 01:00 653 -rw-rw-r-- 1 svn svn 7114 Mar 26 01:01 6530 -rw-rw-r-- 1 svn svn 8653 Mar 26 01:01 6531 -rw-rw-r-- 1 svn svn 6836 Mar 26 01:01 6532 -rw-rw-r-- 1 svn svn 3308 Mar 26 01:01 6533 -rw-rw-r-- 1 svn svn 3918 Mar 26 01:01 6534 -rw-rw-r-- 1 svn svn 3237 Mar 26 01:01 6536 -rw-rw-r-- 1 svn svn 3195 Mar 26 01:01 6537 -rw-rw-r-- 1 svn svn 27725 Mar 26 01:01 6538 -rw-rw-r-- 1 svn svn 263473 Mar 26 01:01 6539
[root@server]# ls -la 6535 -rw-rw-r-- 1 root root 3486 Mar 26 01:01 6535
这里有一些有趣的东西.所以我发现了这个问题,因为在我的shell脚本中,它将无法删除,因为6535由root拥有.运行“rm -rf”后,文件实际显示出来.我之前尝试过,它无法删除目录,因为它告诉我目录不是空的.我进去看了看,肯定的是,文件“6535”终于出现了.不知道为什么会这样做.
strace说以下
#strace ls -la 653* 2>&1 | grep ^open open("/etc/ld.so.cache",O_RDONLY) = 3 open("/lib64/tls/librt.so.1",O_RDONLY) = 3 open("/lib64/libacl.so.1",O_RDONLY) = 3 open("/lib64/libselinux.so.1",O_RDONLY) = 3 open("/lib64/tls/libc.so.6",O_RDONLY) = 3 open("/lib64/tls/libpthread.so.0",O_RDONLY) = 3 open("/lib64/libattr.so.1",O_RDONLY) = 3 open("/etc/selinux/config",O_RDONLY) = 3 open("/proc/mounts",O_RDONLY) = 3 open("/usr/lib/locale/locale-archive",O_RDONLY) = 3 open("/proc/filesystems",O_RDONLY) = 3 open("/usr/share/locale/locale.alias",O_RDONLY) = 3 open("/usr/share/locale/en_US.UTF-8/LC_TIME/coreutils.mo",O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US.utf8/LC_TIME/coreutils.mo",O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en_US/LC_TIME/coreutils.mo",O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.UTF-8/LC_TIME/coreutils.mo",O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en.utf8/LC_TIME/coreutils.mo",O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/en/LC_TIME/coreutils.mo",O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/nsswitch.conf",O_RDONLY) = 3 open("/etc/ld.so.cache",O_RDONLY) = 3 open("/lib64/libnss_files.so.2",O_RDONLY) = 3 open("/etc/passwd",O_RDONLY) = 3 open("/etc/group",O_RDONLY) = 3 open("/etc/mtab",O_RDONLY) = 3 open("/proc/meminfo",O_RDONLY) = 3 open("/etc/localtime",O_RDONLY) = 3