User Name
Password
AppleNova Forums » Genius Bar »

How to trash the trash?


Register Members List Calendar Search FAQ Posting Guidelines
How to trash the trash?
Thread Tools
Messiahtosh
Apple Historian
 
Join Date: May 2004
 
2004-11-22, 16:15

I want to delete some content in my trash can, but I get a message that says something is in use when it's not. I want to delete it, and I don't care what the system is telling me. How do I "force-delete" what's in my trash?

"We are reviewing some 9,000 recent UNHCR referrals from Syria. We are receiving roughly a thousand new ones each month, and we expect admissions from Syria to surge in 2015 and beyond." - Anne C. Richard, Assistant Secretary, Bureau of Population, Refugees, and Migration
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2004-11-22, 16:25

Type exactly as entered, double-check it, and triple-check it before pressing enter. A typo here could be disastrous:

sudo rm -rf ~/.Trash

Alternatively, you could type this (without pressing enter afterwards):

sudo rm -rf

...add a space to the end of that, and then drag the offending file into the Terminal window. It'll auto-complete the path for that specific file. Then, press enter and it'll force it to be deleted.

If you don't want to play with the Terminal, I do believe there are several utilities on MacUpdate that will force delete the trash for you.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
Messiahtosh
Apple Historian
 
Join Date: May 2004
 
2004-11-22, 16:36

The ever helpful Brad has done it again! Thanks man.
  quote
BarracksSi
BANNED
I am worthless beyond hope.
 
Join Date: Jul 2004
Location: Washington, DC
 
2004-11-22, 18:26

Doesn't it work to option-click the Empty Trash command?
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2004-11-22, 21:12

Yes and no.

Holding the option key does two things. 1: It empties the trash without notification. 2: It deletes locked files.

Files that are "in use" are treated differently than locked files because any processes accessing them may crash. On very rare occasions, particularly if a program or the whole system hangs or crashes, some files may be left in this "in use" state.

The quality of this board depends on the quality of the posts. The only way to guarantee thoughtful, informative discussion is to write thoughtful, informative posts. AppleNova is not a real-time chat forum. You have time to compose messages and edit them before and after posting.
  quote
curiousuburb
Antimatter Man
 
Join Date: May 2004
Location: that interweb thing
 
2004-11-22, 21:34

You can also restart the Mac... usually "in use" flags get reset and Trash can be emptied.
  quote
Chinney
Veteran Member
 
Join Date: May 2004
Location: Ottawa, ON
 
2004-11-23, 00:04

Quote:
Originally Posted by curiousuburb
You can also restart the Mac... usually "in use" flags get reset and Trash can be emptied.
That's the way I have always done it.

I don't know if I would want to risk Brad's method. Tyyypos are just tooo easy two doo.
  quote
scratt
Veteran Member
 
Join Date: Jul 2004
Location: M-F: Thailand Weekends : F1 2010 - Various Tracks!
Send a message via Skype™ to scratt 
2004-11-23, 00:16

Another way is to choose "Secure Empty Trash".
Just next to "Empty Trash" in the Finder menu.

I am not sure why it works but it does... If you look at the purpose of secure empty trash it seems to have nothing to do with getting rid of busy or locked files... But it does.

It does mean you don't have to reboot and you don't have to risk typos on scary commands!!

'Remember, measure life by the moments that take your breath away, not by how many breaths you take'
Extreme Sports Cafe | ESC's blog | scratt's blog | @thescratt
  quote
autodata
hustlin
 
Join Date: May 2004
 
2004-11-23, 10:17

Quote:
Originally Posted by Chinney
I don't know if I would want to risk Brad's method. Tyyypos are just tooo easy two doo.
Well, a safer way might be to cd ~/.Trash then ls to make sure you are in the right place and to get the filenames, then rm -rf [filename] on each one individually.

But if secure empty trash works, that looks like the best way to go.
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-11-23, 11:26

i think secure trash emptying is just the OS' way of hiding "sudo rm -fr ~/.Trash/*". and using sudo means "dont fuck with me. i'm root."
  quote
scratt
Veteran Member
 
Join Date: Jul 2004
Location: M-F: Thailand Weekends : F1 2010 - Various Tracks!
Send a message via Skype™ to scratt 
2004-11-23, 11:51

I thought the intended purpose of "Secure Empty Trash" was to zero the contents of the space used to store the files...

It seems to take an awfully long time which would suggest it is infact doing that.

But it seems that the handy side effect is that it also does the "Don't fuck with me" thing and ignores any kind of file in use, or file locked tags.

Probably far to dangerous to have a single click to start it!
It would be cool if it had a little saftey cover like the Burn widget in iTunes.

Anyway have to dash now.. Off to the Full Moon Party... It's a day's journey from Bangkok... And I want to get there for the warm up...

See ya on the flip side... :smokey:

'Remember, measure life by the moments that take your breath away, not by how many breaths you take'
Extreme Sports Cafe | ESC's blog | scratt's blog | @thescratt
  quote
autodata
hustlin
 
Join Date: May 2004
 
2004-11-23, 11:54

it's probably sudo srm, but I don't remember hearing it was doing it under sudo.
  quote
thuh Freak
Finally broke the seal
 
Join Date: May 2004
 
2004-11-23, 12:31

Quote:
Originally Posted by autodata
it's probably sudo srm, but I don't remember hearing it was doing it under sudo.
o yea, i forgot about that part. but even if its not using sudo, it seems to get root access somehow.
  quote
curiousuburb
Antimatter Man
 
Join Date: May 2004
Location: that interweb thing
 
2004-11-23, 12:36

Quote:
Originally Posted by scratt
Anyway have to dash now.. Off to the Full Moon Party... It's a day's journey from Bangkok... And I want to get there for the warm up...

See ya on the flip side... :smokey:
Full Moon parties are good... Black Moon parties are better (if you can remember them).

At least it was like that near Koh Phangan late last century.
  quote
BarracksSi
BANNED
I am worthless beyond hope.
 
Join Date: Jul 2004
Location: Washington, DC
 
2004-11-23, 15:47

Quote:
Originally Posted by scratt
I thought the intended purpose of "Secure Empty Trash" was to zero the contents of the space used to store the files...

It seems to take an awfully long time which would suggest it is infact doing that.
You mentioned it before I got back from work..

Yup, that's what "Secure Empty Trash" does -- writes over the data in multiple passes, scrambling it to Department of Defense standards for erased data. The regular "Empty Trash" command just deletes it out of the index, effectively putting a "1" in front of the file. That's why someone can recover files that you "deleted" just by choosing Empty Trash.

This was a noteworthy item when Panther came out. I'm surprised that it's not common knowledge by now.
  quote
curiousuburb
Antimatter Man
 
Join Date: May 2004
Location: that interweb thing
 
2004-11-23, 18:01

Quote:
Originally Posted by BarracksSi
You mentioned it before I got back from work..

Yup, that's what "Secure Empty Trash" does -- writes over the data in multiple passes, scrambling it to Department of Defense standards for erased data. The regular "Empty Trash" command just deletes it out of the index, effectively putting a "1" in front of the file. That's why someone can recover files that you "deleted" just by choosing Empty Trash.

This was a noteworthy item when Panther came out. I'm surprised that it's not common knowledge by now.
OS 9 empty trash (and most Windows OS) just remove knowledge of the file from the index or FAT table and generally don't actually delete the file, just the references to it.

Part of the reason is may be possible to undelete such a file is that no overwrites of the data take place because it is possible that no other process has reclaimed the disk space. If you've had lots of disk activity since your deletion, the odds of recovering any file drop due the chance its space has been reclaimed or overwritten since.

OS X (most 'nix) always has multiple processes running, some with hefty Virtual Memory demands.
OS X (most 'nix) aggressively reclaim drivespace and 'defrags files under 20MB on the fly'.
OS X empty trash (a shell for 'nix rm -rf) has no 'undelete' option. File is toast.

The combination of the first two conditions alone dramatically increases the chance a file's data gets overwritten or reclaimed and tend to mean deleted data in 'nix is unrecoverable.

As for the 'secure empty trash' being noteworthy in Panther, a similar toolset to actively overwrite DoD3/7/9 times has existed since at least the nineties.

Incinerator, Shredder, and various other 3rd party DAs or apps shipped for just such a market.

Apple has finally rolled some more security into the default install... same as FileVault and the earlier incarnations of encrypted disk images. But if you really wanted a secure laptop before now, you could have bought the clunky Mac OS 9 version of PGP, too.

Apple may have absorbed a technology or integrated one into a more elegant solution. Doubt the overwriting software was proprietary, though in these days of the DMCA who knows.
  quote
autodata
hustlin
 
Join Date: May 2004
 
2004-11-23, 18:54

Quote:
Originally Posted by curiousuburb
Apple may have absorbed a technology or integrated one into a more elegant solution. Doubt the overwriting software was proprietary, though in these days of the DMCA who knows.
Like I said above, my understanding is that it's using srm.

Does anyone know if 'empty trash' is using rm with some flags or is it something totally different?

Last edited by autodata : 2004-11-23 at 19:00.
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools

« Previous Thread | Next Thread »

All times are GMT -5. The time now is 23:40.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2020, AppleNova