Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How do I undo this terminal command?

I was trying to empty the trash of some 40 gb of video. When I tried to empty the trash it said that the files where in use so I used this command to do what I thought would delete them "rm -rf ~/.Trash/*" all the files disappeared from the trash but I don't have any more disk space, so I think the files are just hidden, but I don't know for sure. How do I undo this?

MacBook Pro (13-inch Mid 2010), Mac OS X (10.6.8)

Posted on Aug 2, 2012 1:10 PM

Reply
5 replies

Aug 2, 2012 1:17 PM in response to CalebfromNC

They were actually deleted. If the amount of free space the Finder lists hasn't changed, press the Control and Option keys, click its Dock icon, and choose Relaunch.


If the files were actually in use, you'll need to quit the program which was using them before the space they used will be freed. This may require logging out or restarting.


(68460)

Aug 2, 2012 1:32 PM in response to CalebfromNC

rm -rf ( whatever follows .. )



Please : NEVER DO THAT AGAIN.


As root in Unix,Linux or OSX you can kill the complete OS with this command.


Please only use the GUI driven method to empty the trash. If it is stuck then use system tools like "Cache Cleaners", "Onyx" "Cocktail" and under what names they all are being available.

Aug 3, 2012 6:40 AM in response to CalebfromNC

When I tried to empty the trash it said that the files where in use

That means the file were still in use, and as long as they are still in use, the storage will remain allocated.


All you did was remove the name of the file from a directory (like removing a phone number for an address book; it does not get rid of the actual phone). All references to the file (including programs that have the file open, will keep the file around even if it no longer has a name.


You could use the lsof command to try and find out what program is using the file. Or you could reboot your Mac which will cause all program to exit, and any files still in use to be closed, and if they were deleted, then free the storage.


If after a reboot, you do not get the storage back, then boot from the Mac OS X Lion Recovery partition, and run Disk Utility -> Repair to get your storage back.

How do I undo this terminal command?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.