95
votes
Accepted
Cannot ls ~/.Trash in the Terminal in Catalina (operation not permitted)
You have to give the Terminal.app Full Disk permissions in the security settings.
38
votes
Accepted
If I delete photos/files why aren't they actually deleted? How come they can be recovered?
Short answer
By moving a file to Trash and then emptying the trash, or by doing a quick format of a traditional hard drive (i.e. not a solid state drive), you're actually not deleting files. Instead, ...
34
votes
How do I force the Trash to empty on El Captan?
You can use 'rm' with the '-f' option:
sudo rm -rf ~/.Trash /Volumes/*/.Trashes
Be very careful if you manually type this in.
This empties the trash in your home folder and any trash on any other ...
grg♦
- 199k
27
votes
Accepted
How can I skip the Trash when deleting a file?
⌘ Command⌥ Option⌫ Delete will permanently delete files, with a confirmation dialog warning that this action can not be undone. ⌘Command⌫ Delete simply moves files to Trash, without confirmation.
...
21
votes
Folder won't delete from Trash for "Can't delete "_ImageItems" because its pathname is too long"
For those who're using El Capitan or later version of macOS - simply using the command given in previous answers will return a warning that there were no matches found.
What you need to do instead is ...
18
votes
Accepted
Accidentally deleted everything from a directory on my Macbook using terminal
Restoring from backup is the way to go here, there is no magic „undo rm -rf“ command.
16
votes
How to stop OS X from writing Spotlight and Trash files to memory cards and USB sticks?
Update — 2021 December
I tested the latest version of Clean My Drive 2 on an M1 Mac, and am happy to report it still works perfectly. The developer continues to update and support the app, which is ...
15
votes
Accepted
How do I delete a single file from the Trash?
This seems to work on El Capitan. Control-select the file, then Delete Immediately from pop-up menu and confirm.
15
votes
Accepted
How do I force the Trash to empty on El Captan?
If you select an item or items and click on the “File” menu, there’s a “Move to Trash” choice; however, if you hold down the Option key with that “File” menu open, “Move to Trash” will switch to “...
15
votes
Accepted
How to "Secure Empty Trash..." (wipe free space) on OS X El Capitan?
The secure delete option was removed from El Capitan, but as explained in this article, there may be some alternatives you may wish to use (see below for notes if the Mac has an SSD).
You can use the ...
13
votes
Can't remove file from trash
This is a known issue that has impacted a number of users following an upgrade to Catalina1.
The best way to resolve this is to disable System Integrity Protection (SIP), delete the files/empty the ...
12
votes
Accepted
How can I delete Time Machine backups, moved into trash?
To remove or move the Backups.backupdb folder open Terminal.app.
Enter cd /Volumes/<Name_of_BackupDrive>/.Trashes to change the working directory. <Name_of_BackupDrive> has to be the ...
12
votes
Accidentally deleted everything from a directory on my Macbook using terminal
You do not need to restore your whole machine. You need to restore only one folder. Time machine is much faster than I assume. Seems like a big deal to me since I've been trained never to relay on ...
11
votes
Accepted
Desktop, Documents, and Downloads folders are gone after deleting Dropbox
What's Wrong
It seems like you turned on Dropbox's feature for "computer backup" where it replaces those folders with folders on Dropbox. That is the default, because Dropbox wants you to do ...
10
votes
How to stop OS X from writing Spotlight and Trash files to memory cards and USB sticks?
MacOS now provides this direct flag that you can toggle from Terminal:
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
10
votes
Accepted
System Integrity Protection prevents Trash from being emptied
Shutdown your laptop.
Press Command + R and then the power button to boot into recovery mode.
Click the Utilities menu and select Terminal.
Type csrutil disable and press return.
Close the Terminal ...
9
votes
How to stop OS X from writing Spotlight and Trash files to memory cards and USB sticks?
Update for Catalina and later
On Catalina and later, you might get an error saying "Operation not permitted" when trying to delete metadata stores on removable volumes using Terminal. To fix ...
9
votes
If I delete photos/files why aren't they actually deleted? How come they can be recovered?
The files on the hard drive are all around and the system keeps pointers that point to the files. When you delete the file, you really only delete the pointer and the data is still there, but you can'...
8
votes
How do I delete a single file from the Trash?
The keyboard shortcut ⌘ command + ⌥ option + delete removes the file permanently. This works from anywhere in Finder (including the Trash) on El Capitan and higher, but not on previous versions of OS ...
8
votes
Is it possible to delete the "useless" apps pre-installed on my Mac?
The original question was posted before the days of System Integrity Protection (SIP), so this address SIP enabled versions of macOS thru the current macOS Mojave...
Not that I recommend deleting pre-...
8
votes
Accidentally deleted everything from a directory on my Macbook using terminal
I used to make the same mistake frequently with rm -rf at my last job. One technique that I learned from another engineer was to, instead of navigating the the directory you want to empty, navigate to ...
7
votes
How to Secure erase files in OS X without moving the files into trash?
If you want to make sure that your files, deleted or otherwise, cannot be recovered, just turn on FileVault to encrypt your disk.
Multiple erases or writes on SSDs do not make the file "more"...
7
votes
Emptying trash, with file-in-use: Is there any difference between 'skip' and 'continue'?
I couldn't find any documented proof but still, here is my answer.
When you first hit above shown error, it means you can
Skip i.e. don't try to trash mentioned file and continue trashing the rest
...
7
votes
How to "Secure Empty Trash..." (wipe free space) on OS X El Capitan?
The reason for removing this option has been explained here by Apple:
An issue existed in guaranteeing secure deletion of Trash files on some systems, such as those with flash storage. This issue ...
6
votes
How can I add Trash icon to the sidebar in Mac OS X Lion?
According to this article, each partition has its own trash folder, so dragging one to the sidebar is not a global trash. This script is:
on open
tell the application "Finder"
move the ...
6
votes
Accepted
Unable to clear Xcode from Trash. Force clear in Terminal returns permission error?
sudo rm -rf ~/.Trash/*
is your friend.
I would think cause of the errors are permissions, perhaps Xcode sets files with permissions exclusive to root (superuser).
What sudo does is run the ...
6
votes
Folder won't delete from Trash for "Can't delete "_ImageItems" because its pathname is too long"
You can use the command line in the terminal.
rm -rvf ~/.Trash/*
For completeness sake the options here from the rm man page:
-f Attempt to remove the files without prompting for confirmation,
...
5
votes
If I delete photos/files why aren't they actually deleted? How come they can be recovered?
Emptying the trash doesn't erase the space the files occupied on the disc: it just marks that space as available to be used again. If the space hasn't been reused, the data is still there and can be ...
5
votes
Accepted
How to open a files that's currently in Trash
To avoid the message, e.g., "The document “Filename.mkv” can’t be opened because it’s in the Trash. To use this item, first drag it out of the Trash.", and open the target file without having to ...
5
votes
cannot access files in trash previously on external harddrive
The drive-wide Trash contains the deleted files of all users, with one directory per numerical User ID. Run
ls -l /Volumes/edrive/.Trashes
to see that 503 is a directory, and
ls -l /Volumes/edrive/....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
trash × 302macos × 164
finder × 94
terminal × 49
time-machine × 19
mac × 15
backup × 14
hard-drive × 13
catalina × 13
permission × 12
email × 10
mail.app × 9
applications × 8
command-line × 8
high-sierra × 8
snow-leopard × 8
mojave × 7
external-disk × 7
filesystem × 7
data-recovery × 6
usb × 5
photos × 5
bash × 5
recovery × 5
gmail × 5