我似乎无法删除一堆文件;所有这些文件的共同点如下:
- 它们都是符号链接,或者父目录
- 它们全都归未映射的用户和组所有
那是:
sh-3.2# find . -type l -exec ls -ld {} \;
lrwxrwxrwx 1 1001 1001 14 10 Apr 2011 ./kernel/kernel -> linux-2.6.38.2
lrwxrwxrwx 1 1001 1001 15 25 May 2011 ./kernel/logo/logo.ppm -> skull-black.ppm
lrwxrwxrwx 1 1001 1001 19 2 Sep 15:12 ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0 -> libdefault.so.0.0.0
lrwxrwxrwx 1 1001 1001 17 2 Sep 15:12 ./redhat/BUILD/gol-git/display/nico2/.libs/libnico2.so -> libnico2.so.0.0.0
lrwxrwxrwx 1 1001 1001 15 15 Jul 2011 ./redhat/BUILD/libg15-1.2.7/.libs/libg15.so -> libg15.so.1.0.0
lrwxrwxrwx 1 1001 1001 15 15 Jul 2011 ./redhat/BUILD/libg15-1.2.7/.libs/libg15.so.1 -> libg15.so.1.0.0
sh-3.2# find . -type d -exec ls -ld {} \;
drwxrwxrwx 4 root wheel 136 23 Jan 10:55 .
drwxrwxrwx 3 root wheel 136 22 Jan 22:33 ./kernel
drwxrwxrwx 2 root wheel 102 22 Jan 22:31 ./kernel/logo
drwxrwxrwx 3 root wheel 102 23 Jan 10:55 ./redhat
drwxrwxrwx 4 root wheel 136 23 Jan 10:55 ./redhat/BUILD
drwxrwxrwx 3 root wheel 102 23 Jan 10:55 ./redhat/BUILD/gol-git
drwxrwxrwx 4 root wheel 136 23 Jan 10:55 ./redhat/BUILD/gol-git/display
drwxrwxrwx 3 root wheel 102 22 Jan 22:21 ./redhat/BUILD/gol-git/display/default
drwxrwxrwx 2 root wheel 102 22 Jan 22:33 ./redhat/BUILD/gol-git/display/default/.libs
drwxrwxrwx 3 root wheel 102 22 Jan 22:21 ./redhat/BUILD/gol-git/display/nico2
drwxrwxrwx 2 root wheel 102 23 Jan 11:00 ./redhat/BUILD/gol-git/display/nico2/.libs
drwxrwxrwx 3 root wheel 102 22 Jan 22:21 ./redhat/BUILD/libg15-1.2.7
drwx------ 2 root wheel 136 22 Jan 22:21 ./redhat/BUILD/libg15-1.2.7/.libs
sh-3.2# find . -not -type d -a -not -type l -exec ls -ld {} \;
sh-3.2#
关于删除:
sh-3.2# ls -l ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0
lrwxrwxrwx 1 1001 1001 19 2 Sep 15:12 ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0 -> libdefault.so.0.0.0
sh-3.2# rm -f ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0
sh-3.2# ls -l ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0
lrwxrwxrwx 1 1001 1001 19 2 Sep 15:12 ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0 -> libdefault.so.0.0.0
sh-3.2# rm ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0
rm: ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0: No such file or directory
sh-3.2# ls -li !$
ls -li ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0
282892 lrwxrwxrwx 1 1001 1001 19 2 Sep 15:12 ./redhat/BUILD/gol-git/display/default/.libs/libdefault.so.0 -> libdefault.so.0.0.0
sh-3.2#
有问题的 HFS 卷的挂载选项如下:
- hfs、本地、nodev、nosuid
答案1
这些是符号链接。您想删除链接还是原始文件?(无论哪种方式,rm 都应该有效。)您可以尝试unlink
,但这是更危险的选择。您也可以尝试sudo rm
,尽管我不确定这是否会对您的情况产生任何影响。最后一个选项是尝试使用更改所有者sudo chown
。(但同样,这可能不适用于认为自己不存在的文件......)