Apple Blog

Emptying the wastebasket in OS X with Terminal

As Mac users, there inevitably comes a time when we have to empty our computer’s wastebasket . This wouldn’t be a problem if it weren’t for the fact that the computer freezes or we get errors that a certain file can’t be deleted because of security problems or because some application is using it.

But for all this there is a very simple and at the same time very fast solution , to empty the trash can from the Terminal. To do this we’ll have to execute a simple command line. These are the steps to follow.

  1. We open the terminal either from Spotlight or from the Utilities folder in the Applications folder.
  2. We type the following command line: Sudo rm-rf ~ Trash *
  3. Press Enter to execute the command 4. Enter your user password, as it will be required by the terminal, and press Enter again
Emptying the wastebasket in OS X with Terminal
Emptying the wastebasket in OS X with Terminal

As a contribution, we must take into account that we must close the Trash window and not have it open during the process , otherwise the process will fail.

That’s it, it’s that easy to run this command line and empty the trash from the terminal so you don’t find any problems in between. It’s especially useful if you have a huge amount of files in your trash can , because that’s when problems are most likely to occur.

We already know another trick for the Recycle Bin , remember that we recently saw how to replace the icon of the trash can with a Mac Pro. Now you can empty the trash can like a ninja .

Similar Posts