How to Quickly Empty Recycle Bin in macOS Using Terminal

When you delete a file on your Mac, you’ll just hide it in the Finder. To delete it and free up the associated disk space, you must empty the Recycle Bin. Control when clicking Garbage icon and select Empty the trash option is the fastest way to do it.

However, permanently removing Trash content is not always easy and can lead to errors. So, if you run into any issues, you can quickly empty the Recycle Bin in macOS using Terminal. You will find the complete process below.

Empty the Recycle Bin in Mac using Terminal (macOS El Capitan and later)

If you use a Mac running macOS 10.11 El Capitan or later (such as Big Sur or Monterey), you can quickly empty the Trash using Terminal.

1. Open Launchers and choose Other > End.

2. Enter the following command:

sudo rm -r

Note: The command has not been run.

3. Press the button Space key once to add a space at the end of the command. It is essential to be able to do that. Otherwise, the command will fail.

4. Open Garbage.

5. Select the files you want to delete while pressing and holding Request Key. If you want to delete everything, press Request + One to highlight all files and folders instantly.

6. Drag the marked files to the Trash. Depending on how many items you want to remove, multiple file paths may show up in Terminal.

7. Press enter.

8. Enter your administrator password.

9. Press enter. Terminal will delete the specified items from the Recycle Bin. You won’t get a confirmation, so it’s best to double check.

If Terminal fails to delete a particular file or files, add f (force) option will override problems caused by permission conflicts. Type sudo rm -rf in step 2.

Emptying the Trash will permanently delete files (unless you set up Time Machine on your Mac). Therefore, if you want to confirm before deleting each time, you can use I (interactive) optional — for example: sudo rm -ri.

Clearing the Recycle Bin in Mac using Terminal (macOS Yosemite and earlier)

On a Mac running macOS 10.10 Yosemite or earlier, emptying the Trash using Terminal is relatively simple.

1. Open Launchers and choose Other > End.

2. Enter the following command:

sudo rm -rf ~ / .Trash / *

3. Press enter.

4. Enter your administrator password.

5. Press enter.

Alternative ways to delete problematic files in the recycle bin

Emptying the Recycle Bin using Terminal is very quick. But it’s also inconvenient. If you can’t empty the Recycle Bin using the GUI (graphical user interface) in macOS due to a specific file or files, run through the pointers below next time.

Delete items one by one

Try deleting the problematic files or folders one by one. To do that, open the Trash, hold down the Control key on the offending item, and select Delete immediately.

Unlock file and check permissions

macOS may prevent you from deleting a locked file or folder. Try unlocking it. To do that, hold down the Control key while clicking on the Trash item and select Receive information. Then uncheck the box next to Locked.

While you’re at it, you might also want to scroll down Share & Permissions section and setting Exclusive right arrive Reading and writing for your user account. You may not be able to do that if you don’t have administrative privileges.

Force quit related programs

Try quitting any program that might be preventing you from permanently deleting a file or folder. You can do that by Control-clicking a program’s icon via your Mac’s Dock and selecting Give up. For example, if you’re having trouble deleting the Pages document, quit completely Pages application.

Also, you may want to check if the program involved is stuck. To do that, open Apple menu and select Forced to quit. If the program appears in the list, select the item and select Forced escape. This is other ways to force quit apps in macOS.

Restart your Mac

Restarting your Mac can also help resolve errors, glitches, and conflicts that are preventing you from emptying the Recycle Bin.

Just open Apple menu and select Restart. Then put the box next to it Reopen window when re-login deselect and select Restart.

Disable conflicting startup programs

If you continue to have problems emptying the Recycle Bin normally, you may have a conflicting program that starts with macOS.

To delete it, open Apple menu and select System Preferences > Users & Groups. Then select your user account on the sidebar and switch to Login items navigation. Follow that by selecting and removing any apps that might be causing problems with a particular file format.

Start your Mac in Safe Mode can also help you identify problematic or poorly-started programs and extensions that are causing the problem.

Throw it in the trash

While it’s possible to empty the Trash using Terminal in macOS, it’s best to use the graphical user interface, if possible. Taking the time to figure out what’s stopping you from deleting files in your Mac’s Trash instead of forcibly deleting its contents can help you avoid the same problem later on.

That being said, if you end up permanently deleting files and folders that you want to recover later, don’t forget recover lost items with Time Machine.

Leave a Reply

Your email address will not be published. Required fields are marked *