Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Prevent local files from being deleted immediately System
Recently when I went to delete a file in the Finder, I was prompted with a dialog box warning me that the file would be deleted immediately. It appeared that this was only the case when I went to delete a file stored in my FileVault protected home directory. Deleting other files resulted in them being placed in the trash, as should normally be the case.

As it turns out, this was a result of a directory by the name of .Trash not being present in my home directory. To fix this:
  1. Open Terminal.
  2. Type cd ~ (i.e. go to your home directory if not there already).
  3. Type mkdir .Trash (you may need to use sudo to accomplish this).
  4. Make sure the owner is set to your user name.
  5. The permissions should be 700 (i.e. full permissions for you, no permissions for anyone else).
Once I had recreated the .Trash directory, files I attempted to delete were properly placed in the trash can, and not forced to be deleted immediately.
    •    
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[17,488 views]  

Prevent local files from being deleted immediately | 4 comments | Create New Account
Click here to return to the 'Prevent local files from being deleted immediately' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Prevent local files from being deleted immediately
Authored by: murali1080 on Mar 22, '06 04:11:19PM

Or simply option + right click on Finder icon in the Dock and relaunch it (or using Force Quit menu, etc.). That one step without the terminal being invovled would do the enitre trick.
Anyway you need to relaunch the Finder after creating the folder and changing its permission according to this hint, for it to work.

If you still need this trick, use one command to create and set permissions at the same time:
mkdir -m 700 .Trash
when you are in your home directory (~).



[ Reply to This | # ]
Prevent local files from being deleted immediately
Authored by: boredzo on Mar 22, '06 04:46:22PM

Note: cd by itself is enough to change to your home directory. You don't need to be explicit in this case.

(AFAIK, cd is the only command that has that feature, though.)



[ Reply to This | # ]
Prevent local files from being deleted immediately
Authored by: ascanio on Mar 22, '06 11:08:17PM

Since the same happens (for the same reason, I think, "mutatis mutandis") when you delete a file on a network volume, where should the missing .Trash be created? Or maybe there is no solution...



[ Reply to This | # ]
Prevent local files from being deleted immediately
Authored by: chris_on_hints on Mar 23, '06 12:51:07PM
note that the opposite is also possible - make a file (*not* a directory) called ".Trash" and you can force files to be deleted. I use this on USB memory sticks so that files deleted from it are gone immediately, rather than still taking up space on the stick... try the following in the terminal, when at the root directory of an external hard disk or usb stick:
touch .Trash
enjoy!

[ Reply to This | # ]