Time Machine Backups, Delete from Trash
I made a mistake and deleted time machine backups and now they are all stuck in my trash. How do i delete multiple time machine backups from trash?
iMac 21.5″, macOS 12.0
I made a mistake and deleted time machine backups and now they are all stuck in my trash. How do i delete multiple time machine backups from trash?
iMac 21.5″, macOS 12.0
The backups are likely large. Reboot your Mac then try emptying the Trash and just be patient, it may take considerable time. Or you can open Terminal and do the following:
Type this PRECISELY, be sure you got it right before you press Return:
rm -rfv ~/.Trash/*
The '-v' option should list the files that are being deleted. It may still take some time to complete, wait for the cursor to return back to a prompt before closing Terminal.
The backups are likely large. Reboot your Mac then try emptying the Trash and just be patient, it may take considerable time. Or you can open Terminal and do the following:
Type this PRECISELY, be sure you got it right before you press Return:
rm -rfv ~/.Trash/*
The '-v' option should list the files that are being deleted. It may still take some time to complete, wait for the cursor to return back to a prompt before closing Terminal.
When you put files in the Trash they are actually placed inside a hidden folder inside your home folder named, ".Trash". The terminal command translates to:
Forcefully remove the Files & Folders within the home folder (~) inside the (.Trash/) folder and display the deletion results in a verbose (-v) manner and don't ask me to confirm it, etc.
rm -rfv ~/.Trash/*
The longer format would be:
rm -r -f -v /Users/<yourusername>/.Trash/*
The tilde ~ symbol = /Users/<yourusername> home folder. You can combine (-r -f -v) as (-rfv).
Be cautious with the "rm -rf" combination as it means delete recursively and force it and do not confirm you are sure. What I am recommending is that you delete all the files in the ~/.Trash/* folder aggressively. This usually works and if it doesn't you can also try:
sudo rm -rfv ~/.Trash/*
Which means Super User Do which would prompt for your password before it runs.
If none of this works, try P.Phillips suggestion of disabling SIP and enabling SIP afterwards. It all comes down to the permissions on the files from the Time Machine backup. They might have special permissions for Time Machine and snapshots might be protected with System Integrity Protection.
Normally, I would just format a Time Machine drive rather than delete the contents. If you are talking about Time Machine snapshots, you can now clear them from Disk Utility after selecting View -> Show APFS Snapshots.
Use the method already supplied First.
Should one not be successful >>
Disable SIP via recovery mode csrutil and then remove the file in question and then Enable SIP again as soon as done.
Disable System Integrity Protection Temporarily
To disable SIP, do the following:
Warning
Disable SIP only temporarily to perform necessary tasks, and reenable it as soon as possible. Failure to reenable SIP when you are done testing leaves your computer vulnerable to malicious code.
Enable System Integrity Protection
To reenable SIP, do the following:
Thank you.
To confirm after I type exactly this rm -rfv ~/.Trash/* in Terminal, I hit return? I don't have to add (drag and drop) the files from the Trash to the command?
You said "the '-v' option should list the files that are being deleted"...this is just an FYI, not something else I have to do correct? Commands and Terminal are relatively foreign to me so just want to be extra cautious.
Time Machine Backups, Delete from Trash