User Name
Password
AppleNova Forums » Programmer's Nook »

Terminal: rm ./AppleTV.dmg makes file go where?


Register Members List Calendar Search FAQ Posting Guidelines
Terminal: rm ./AppleTV.dmg makes file go where?
Thread Tools
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2009-01-24, 00:43

I recently used this command to get rid of an image I started to create as part of my AppleTV HDD upgrade. When my local HDD filled it failed to complete the image. I cleared off the space and threw that image in the trash as well. When I emptied the trash, Finder wouldn't actually remove AppleTV.dmg because it was in use.

So in Terminal I executed the above command but I didn't get my space back. The file isn't in finder but neither is my space where it was. Where did it go? Is there a Terminal command to empty the trash?

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.”
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.

Last edited by turtle : 2009-01-24 at 00:54.
  quote
Kickaha
Veteran Member
 
Join Date: May 2004
 
2009-01-24, 00:45

It is instantly deleted, no Trash, no recovery, no second chance.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2009-01-24, 00:47

rm deletes the file directly. It doesn't move it to the Trash like the Finder does.

Do you have File Vault enabled for you account? If so, you'll have to log out (while connected to the power supply) for the system to unmount your home directory and "recover free space".

For further investigation as to where your space has gone, may I suggest Disk Inventory X?

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
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2009-01-24, 00:49

Thanks guys.

I wonder why I haven't gotten my space back. I do have Disk Inventory X and was about to use it but thought I had better learn more about a command I just used since it didn't seem to do what I thought it would.

Edit: Ok, space is back. Seems my Mini needs a nap. It's having a hard time keeping up with it's disk space.

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.”
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
scratt
Veteran Member
 
Join Date: Jul 2004
Location: M-F: Thailand Weekends : F1 2010 - Various Tracks!
Send a message via Skype™ to scratt 
2009-01-24, 04:13

I don't know about anyone else, but especially when working remotely, the rm commands and similar scare the bejesus out of me!

I tend to do a quick man check each time before I use them!

'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
Kickaha
Veteran Member
 
Join Date: May 2004
 
2009-01-24, 11:44

Quote:
Originally Posted by turtle2472 View Post
Thanks guys.

I wonder why I haven't gotten my space back. I do have Disk Inventory X and was about to use it but thought I had better learn more about a command I just used since it didn't seem to do what I thought it would.

Edit: Ok, space is back. Seems my Mini needs a nap. It's having a hard time keeping up with it's disk space.
If you were checking the disk space in the Finder, keep in mind it does *not* always show an immediate update of the free space, particularly when you remove the files at the command line. After some Great CLI Purge, I always go back in the Finder and click on the drive in the sidebar - this boots the Finder in the head to update the value at the bottom of the window.
  quote
tomoe
Veteran Member
 
Join Date: Nov 2006
 
2009-01-24, 11:52

Quote:
Originally Posted by scratt View Post
I don't know about anyone else, but especially when working remotely, the rm commands and similar scare the bejesus out of me!

I tend to do a quick man check each time before I use them!
Agreed...that's why I have an alias in my .bashrc file with:

Code:
alias rm='rm -iv'
This way I'm prompted before ever removing a file.
  quote
Brad
Selfish Heathen
 
Join Date: May 2004
Location: Zone of Pain
 
2009-01-24, 12:32

Quote:
Originally Posted by Kickaha View Post
If you were checking the disk space in the Finder, keep in mind it does *not* always show an immediate update of the free space, particularly when you remove the files at the command line. After some Great CLI Purge, I always go back in the Finder and click on the drive in the sidebar - this boots the Finder in the head to update the value at the bottom of the window.
Yup. The Finder can definitely be finicky like that.

Alternatively, while you're in the CLI after the Great Purge, fire off a "df -h" to get an always up-to-date view of your disk usage.

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
turtle
Lord of the Rant.
Formerly turtle2472
 
Join Date: Mar 2005
Location: Upstate South Carolina
 
2009-01-24, 21:48

Thanks for the tips guys. I'm sure the delay was our great Finder then. Oh well.

The good part is my Apple TV now has a 250GB drive in it and playing Finding Nemo for my 2 year old.

Louis L'Amour, “To make democracy work, we must be a nation of participants, not simply observers. One who does not vote has no right to complain.”
Visit our archived Minecraft world! | Maybe someday I'll proof read, until then deal with it.
  quote
Taskiss
Veteran Member
 
Join Date: Jul 2007
Location: St. Louis, MO
 
2009-01-24, 22:15

Old school:

sync;sync;sync
  quote
curiousuburb
Antimatter Man
 
Join Date: May 2004
Location: that interweb thing
 
2009-01-25, 06:42

How about a poll?

rm makes file go where:
  • poof
  • buh-bye
  • to bit heaven
  • to its happy place
  • beer
  quote
ShadowOfGed
Travels via TARDIS
 
Join Date: Aug 2005
Location: Earthsea
 
2009-01-27, 02:07

Welcome to POSIX! Let's turn this into a filesystems lesson.

I know, I know, I'm being a bit of a wise-ass here. It's because this sounds like a case of POSIX filesystems doing things you may not expect.

Even when you remove a file on POSIX systems, the action itself only eliminates the *name* from the filesystem. That is, there will no longer be an entry where you removed the file. BUT, if any processes still have open handles on the file (as is assuredly the case due to your "in use" comment), the underlying contents are kept. The space occupied by a file is only reclaimed after (1) all references to it on the filesystem are removed, and (2) all open handles are closed by processes owning them.

So it's entirely possible (and sometimes, even desired) to open a file, remove it from the filesystem, but still access it using your handle. This gives you truly private data on a filesystem: nobody can find it, as it has no name, and you are the sole owner of the only handle to access it. As soon as you close your file handle, the contents are eliminated.

Your space will be reclaimed, but not until the process with a handle on that disk image is terminated. (If you force a reboot, this is guaranteed to happen.)

Apparently I call the cops when I see people litter.
  quote
Kraetos
Lovable Bastard
 
Join Date: Dec 2005
Location: Boston-ish
 
2009-01-31, 21:51

Quote:
Originally Posted by turtle2472 View Post
I recently used this command to get rid of an image I started to create as part of my AppleTV HDD upgrade.
You accidentally the whole DMG?

Quote:
Originally Posted by curiousuburb View Post
How about a poll?
No /dev/null? Bit bucket? Black hole? Hand over your nerd membership card.
  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
Similar Threads
Thread Thread Starter Forum Replies Last Post
AppleTV update soon? turbulentfurball Speculation and Rumors 53 2009-08-27 05:29
AppleTV Take 2 zippy Apple Products 144 2008-01-30 13:01
AppleTV as Sky+ Replacement spikeh Purchasing Advice 2 2007-04-18 08:58
Will many of you get new 'n' Airport? AppleTV markw10 Apple Products 107 2007-01-22 03:29
Mac mini vs. AppleTV iFerret Purchasing Advice 6 2007-01-13 15:45


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 19:01.


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