4

So here is my problem I have a pretty strange file that I can't get out of my computer.

I tried pretty much everything. First I used software like CleanMyMac, TrashIt, CCleaner etc... None of them was able to do anything.

I tried to throw it to the trash and "secure trash it". It did not complete, so I finally aborted it.

I then tried to use the terminal with a sudo rm -R but no: still there. The file is untrashable because it seems not to exist...

Here is a view of what I got:

sh-3.2# sudo rm -R /Users/Mawel/.Trash/Tunnelblick.app 
rm: /Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks/Sparkle.framework/Resources: No such file or directory
rm: /Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks/Sparkle.framework/Versions/Current: No such file or directory
rm: /Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks/Sparkle.framework/Versions: Directory not empty
rm: /Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks/Sparkle.framework: Directory not empty
rm: /Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks: Directory not empty
rm: /Users/Mawel/.Trash/Tunnelblick.app/Contents: Directory not empty
rm: /Users/Mawel/.Trash/Tunnelblick.app: Directory not empty

Is it basically telling me that there is nothing there and I can't delete nothing?

EDIT

I tried some of your answers especially the one where I force the remove of each file one by one. Here is a sample of what happen :

sh-3.2# cd Sparkle.framework/
sh-3.2# ls -al
total 8
drwxr-xr-x@ 4 root  wheel  136 22 jan  2014 .
drwxr-xr-x@ 3 root  wheel  102 17 jan  2014 ..
lrwxrwxrwx@ 1 root  wheel   26 22 jan  2014 Resources -> Versions/Current/Resources
drwxr-xr-x@ 3 root  wheel  102  9 fév  2014 Versions
sh-3.2# sudo rm -f Resources 
sh-3.2# ls -al
total 8
drwxr-xr-x@ 4 root  wheel  136 22 jan  2014 .
drwxr-xr-x@ 3 root  wheel  102 17 jan  2014 ..
lrwxrwxrwx@ 1 root  wheel   26 22 jan  2014 Resources -> Versions/Current/Resources
drwxr-xr-x@ 3 root  wheel  102  9 fév  2014 Versions
sh-3.2# 

EDIT 2

Thanks to DisplayName I finally manage to remove them by moving them to the /tmp folder and cleaning it.

  • The result of ls -l /Users/Mawel/.Trash/Tunnelblick.app as well as of ls -ld /Users/Mawel/.Trash would be a very nice additional information here, so that we can see the permissions and ownerships in case something is wrong there (it should not be a permission issue, you are running the commands as root). Appart from that, I don't know if you realise that rm -R means "recursively remove" which is usefull to remove contents of a folder and any subfolder(s)... but it is completely nonsense and useless when removing a single file – dave_alcarin Oct 8 '15 at 21:46
  • Does a Mac have a utility option to "check the filesystem"? If so I would suggest you run it. – roaima Oct 8 '15 at 21:49
  • 1
    First of all, please try to write a clear question in clear English.  Don’t say “years” if you don’t mean it (and, if you really mean “years”, you need to be clearer, because what you’re saying doesn’t make sense except as hyperbole).  “get to get” doesn’t make sense and “nup” isn’t a word.  … (Cont’d) – G-Man Says 'Reinstate Monica' Oct 8 '15 at 21:56
  • (Cont’d) …  (2) Are you talking about a file or a directory?  (3) If you have a # prompt, you are probably already superuser (i.e., you’ve logged in as root or invoked su), so sudo is unnecessary.  (4) Type cd /Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks/Sparkle.framework and then ls -laR and post the output.  Please do not respond in comments; edit your question to make it clearer and more complete. – G-Man Says 'Reinstate Monica' Oct 8 '15 at 21:56
4

Move them to /tmp and restart (Or empty /tmp in any other way). I've had this problem before and it's been to only way for me to fix it.

Before doing this you should investigate into why they aren't deleted but use it as a last resort. There are no dangers to doing this but I recommend trying to learn why they aren't deleted before.

  • Ok It did work ! Well though; I still don't know why I could'nt remove them but frankly this is not bothering me :) Thank you ! – Baldráni Oct 9 '15 at 9:24
  • @Baldráni, yeah I though the same when this happened to me. – DisplayName Oct 9 '15 at 12:30
2

Baldrani:

  1. Please login as the Mawel user, and execute the following, authenticating the privileged mode (sudo) with the Mawel user's password. Please report any output returned by the execution of the command.

     sudo chflags -vv -R nouchange,noschange /Users/Mawel/.Trash
    
  2. Please show the output of:

     sudo ls -lO@ABGFR /Users/Mawel/.Trash/
    
  3. Next, please show the output of:

     sudo fuser -fu /Users/Mawel/.Trash
    
  4. Next, please show the output of:

     sudo lsof | grep "/Users/Mawel/.Trash"
    
  5. Finally, please show the output of both:

     sudo stat -x /Users/Mawel/.Trash
    
     sudo find /Users/Mawel/.Trash -type f,d -exec stat -x {} \;
    

F. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

THE SURE-FIRE FIX:

sudo rm -f "/Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks/Sparkle.framework/Versions/*" 
sudo rm -f "/Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks/Sparkle.framework/*"
sudo rm -f "/Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks/*"
sudo rm -fdR "/Users/Mawel/.Trash/Tunnelblick.app/Contents/Frameworks"
sudo rm -fdR "/Users/Mawel/.Trash/Tunnelblick.app"

THE QUICK AND DIRTY FIX:

sudo rm -fdR /Users/Mawel/.Trash/Tunnelblick.app

ALTERNATIVE FIX:

find /Users/Mawel/.Trash/Tunnelblick.app -f -exec rm -f {} \; 

YET ANOTHER ALTERNATIVE FIX (YAAF):

find /Users/Mawel/.Trash/Tunnelblick.app -f -print | xargs -I % rm -f "%"
rm -fdR /Users/Mawel/.Trash/Tunnelblick.app/*
  • None of that is working, I edited my post to let you see what it returns me. – Baldráni Oct 9 '15 at 9:08
  • Baldrani, amigo: – Francis from ResponseBase Oct 11 '15 at 8:47
0

Seeing that output, it seems that your "file" is not a file... rm is seeing Tunnelblick.app as a folder. Folders that are not empty cannot be removed, unless you force the removal. rm -fR [directory] does the trick, but it does not prompt or anything... so be careful!! everything inside the directory, including any content in any subdirectories will be lost forever (or a very long time ;) )

rm -R means "recursively remove", so rm seems to be reading some stuff inside Tunnelblick.app. Try removing without the -R option.

And the last possibility that come to my mind: check your filesystem for inconsistencies that turned it into a read-only filesystem.

0
rm -rf /dir
rmdir /dir

if not working, that mean something wrong with your system!

  • Depends upon the context. The files can be immutable so your command wouldn't work but that definitely would give a different error. – Firelord Oct 9 '15 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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