Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can't seem to delete a pile of files; what all these files have in common is as follows:

  • They're all symbolic links, or otherwise parenting directories
  • They're all owned by an unmapped user and group

That is:

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#

As for the deletion:

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# 

Mount options for the HFS volume in question are as follows:

  • hfs, local, nodev, nosuid
share|improve this question

1 Answer 1

Those are symbolic links. Are you wanting to delete the link or the original file? (Either way, rm should work.) You could try unlink, but it's the more dangerous option. You could also try sudo rm, although I'm not sure if that will have any effect on your situation. A final option would be to try changing the owner using sudo chown. (But again, this may not work with files that think they don't exist...)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.