Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

balestra

macrumors newbie
Jan 30, 2008
6
0
My "going nuts" comment was my reaction to the noise coming from the disk as the script deleted 50GB

50GB is a lot of stuff, I see... For the program you're welcome, of course.

I love this kind of one-trick pony; typically I write them because I need some function, and I want to avoid programming a GUI because I'm too lazy :)
 

chrunchstick

macrumors newbie
Feb 17, 2009
1
0
hooah

hooah this is great i have some vmware stuff in my trash and my mac won't delete them now ther are gone great!!tx to everyone who helped to this script!!:eek:
 

Trip.Tucker

Guest
Mar 13, 2008
946
1
Wow. Long thread. Doing the following in Terminal would work fine:

cd ~/.Trash
sudo rm -fr *

Same for any folder with unwanted files. Using fs_usage would have told you which application had a lock on those files.

Grab a book on the Unix CLI.
 

balestra

macrumors newbie
Jan 30, 2008
6
0
Doing the following in Terminal would work fine:
cd ~/.Trash
sudo rm -fr *
You're right, it works the same... on the only ~/.Trash folder.

Actually the Trash mixes user and system Trash, plus the user and system trash of every mounted volume.

The applet asks the Finder for the trash files path, then deletes them by issuing a "rm -rf" command with administrator privileges.

You can do it manually per each Trash folder, of course.
 

spinnerlys

Guest
Sep 7, 2008
14,328
7
forlod bygningen
I think I messed up. I ran this script, trying to delete a 147GB .log file (Yeah :|) and now the file is gone by my space is still missing 147GB!!! :(

Just saw your reply in your thread, thus the first part is not important anymore. (I also haven't read the rest of this thread.)

And you have emptied the Trash? What .log file was it?
 

ficient1

macrumors newbie
Jan 28, 2011
1
0
Kudos to the creator of SuperEmptyTrash!

Had a couple of stubborn files that would not delete and your program did the trick!
Thanks!
:D
 

Hal Itosis

macrumors 6502a
Feb 20, 2010
900
4
I realize this is a zombie thread, but... looking back at 2008, the OP didn't properly follow some advice:
Ok, try this. Open Terminal, type "rm -rf " and then drag the Trash folder onto that window (or if you want, the folder that's giving you trouble), and then hit enter. If it gives you an error, add "sudo " to the beginning of the previous command and do it again. That shouldn't pay attention to whether those files are open in any OS X application, and especially not if they're not actually in use.

Nope.

---

Last login: Fri Jan 25 18:17:57 on console
172:~ Home$ rm -rf
172:~ Home$ /Volumes/External\ HD/.Trashes/501/1
-bash: /Volumes/External HD/.Trashes/501/1: is a directory
172:~ Home$ sudo rm -rf

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
172:~ Home$ /Volumes/External\ HD/.Trashes/501/1
-bash: /Volumes/External HD/.Trashes/501/1: is a directory
172:~ Home$

:mad::mad::mad:

As can be clearly seen in the Terminal transcript there, the user first entered...

rm -rf

[i.e. he hit return too soon (which asked terminal to remove "nothing"), and got no error because of the -f option]

Then on the *next* line he dropped a folder and hit return again, and got an error (because folders aren't commands).

Then he repeated the same two mistakes with sudo rm -rf

--

The right way is to: first type "rm -rf " without hitting return... and then drop the folder on the same line, and then hit return (which was the advice originally given).
 

8CoreWhore

macrumors 68030
Jan 17, 2008
2,653
1,186
Tejas
I've had this problem... I give the file a new extension like .jpg... then I delete it... no problem. :)

EDIT===

I had a problem occasionally, where I can't delete a file because it's being used, but can't figure out what is using it. I changed the extension to .jpg and then deleted and this worked every time.

BUT I see that it's not the same problem as above.
 
Last edited:

AnthonyDapice

macrumors newbie
Jan 19, 2012
3
0
not even going into trash can

Hey, I know this is porbably a dead thread. but I really need your help!
I have the same problem. Except the file NEVER goes in the Trash can.
It is on a HD, and it keeps saying "The operation can't be completed because the item "yakakadak" is in use.
How do I delete this?
I have tried running all the sudo scripts (properly),
and trying the Super Trash can script.
Nothing.
Why won't it let me.
The initial error was because I was transferring a file to the HD over my network, and there was an error.
Now when I open the folder it is "empty"
but if i open the folder using my TV (directly through usb on my HD) then it shows the "FILES" that are on there, and even though they are of proper format, the TV errors and says "unvailable playback format"

I understand the error, but now the folder I placed these "errored" files in Does not want to be deleted
HELP!

:)
thanks in advance, and I await your replies
 

AnthonyDapice

macrumors newbie
Jan 19, 2012
3
0
Yes i have tried rebooting several times.

I tried all of your links thank you very much, although none gave me a solution,
The problem is its FINDER thats using the "file/folder"
Its on an external hard drive im connecting through a network, I can create folders, rename them, move files into folders. But once the file errors while sending over. Its like a ghost file, and I can't delete it.
It never goes to the trash. Ive tried many different ways.

I'll just plug it into a pc and see it what happens
Thanks anyways
 

HeadphoneAddict

macrumors 65816
Sep 16, 2007
1,041
888
Hey, I know this is porbably a dead thread. but I really need your help!
I have the same problem. Except the file NEVER goes in the Trash can.
It is on a HD, and it keeps saying "The operation can't be completed because the item "yakakadak" is in use.
How do I delete this?
I have tried running all the sudo scripts (properly),
and trying the Super Trash can script.
Nothing.
Why won't it let me.
The initial error was because I was transferring a file to the HD over my network, and there was an error.
Now when I open the folder it is "empty"
but if i open the folder using my TV (directly through usb on my HD) then it shows the "FILES" that are on there, and even though they are of proper format, the TV errors and says "unvailable playback format"

I understand the error, but now the folder I placed these "errored" files in Does not want to be deleted
HELP!

:)
thanks in advance, and I await your replies

I have the same problem, i.e. 14 folders were left behind on the NAS after a failed network copy from my internal drive to this network drive. I can't get any of them to ever move to trash, because finder says the "item is still in use". Since it won't go in the trash, the force-empty trash options don't help.

I tried the [sudo rm -rf /volume/directory] command on a few individual folders that I can't delete, and each time terminal says "folder not empty" and won't delete it. I look in the folder and it's empty in the finder. Get info shows a few bytes in each folder for 1 item. "lsof | grep" doesn't show any process using the directories. If I use tinkertool to show invisible files in finder the directories only have the usually invisible .DS_Store in 12 of the 14 folders.

The Lacie dashboard says the drive is clean, no errors, running the latest NetworkSpace Max firmware. Disk Utility can't do anything with a NAS, so no repair permissions or drive with that.

Any help?

PS: Apple support article (see link) was no help - http://support.apple.com/kb/TS1988
 
Last edited:

balestra

macrumors newbie
Jan 30, 2008
6
0
I have the same problem, i.e. 14 folders were left behind on the NAS after a failed network copy from my internal drive to this network drive.[/URL]
Actually it is not the same problem.

Let me explain: in case the file is hosted on your machine, you can sudo (or use Super Empty Trash) to delete it overriding almost every block.

In your case the file is hosted on a remote File System.
If you sudo on your machine you become the root of your machine, while the issue is on a remote file system.
Regardless of the fact that there is an error or a permission issue, your identity on your machine is totally irrelevant on the remote file system, only your login credentials (used to mount the share) are relevant.

If your NAS can be wired in some way to a machine, and used as a single Hard Drive, then you'll have option to sudo, fix, delete and whatever.

The only other option is to act from NAS host perspective, i.e.: through its web interface.

In every case, to fix this type of issues you are asked to host the File System involved.
 

HeadphoneAddict

macrumors 65816
Sep 16, 2007
1,041
888
Actually it is not the same problem.

Let me explain: in case the file is hosted on your machine, you can sudo (or use Super Empty Trash) to delete it overriding almost every block.

In your case the file is hosted on a remote File System.
If you sudo on your machine you become the root of your machine, while the issue is on a remote file system.
Regardless of the fact that there is an error or a permission issue, your identity on your machine is totally irrelevant on the remote file system, only your login credentials (used to mount the share) are relevant.

If your NAS can be wired in some way to a machine, and used as a single Hard Drive, then you'll have option to sudo, fix, delete and whatever.

The only other option is to act from NAS host perspective, i.e.: through its web interface.

In every case, to fix this type of issues you are asked to host the File System involved.

Thanks!

I went into the Lacie NAS Dashboard (web interface to NAS vis Safari) to see if there was a way to get to the file system, and in the top right corner was an icon for the file browser next to the icon for restarting the NAS or logging out.

I was able to browse the NAS directories through the Lacie file browser, and delete the troublesome folders with no trouble. These were directories that the Mac OSX was saying were in use and could not be deleted.
 

rajivhifi

macrumors member
Jul 31, 2014
68
5
Woohoo!

I'm ecstatic the SuperEmptyTrash script worked for me! OS: Yosemite.

http://www.faqintosh.com/risorse/en/sys/setrash/

My Trash had a folder with hundreds of subfolders that somehow got created from another user, who I deleted a couple of years ago. The damn folder was not deleting any which ways I tried though all the keyboard and terminal shortcuts. I had little expectation but this sweet little program worked on first try. Fantastic! Thanks a ton.
 

Alexg1

macrumors newbie
May 29, 2016
3
0
You place the file in the trash and then left click your mouse and it will say Delete Immediately press that and it will delete! =)
 

GGJstudios

macrumors Westmere
May 16, 2008
44,545
943
You place the file in the trash and then left click your mouse and it will say Delete Immediately press that and it will delete! =)
That didn't work for the OP, who found a resolution to their problem 8 years ago.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.