Command Line Purge App In Mac

Installing applications on macOS and OS X computers is easy to do when deploying the apps as packages through the Terminal using the Installer command for quiet deployments across your network. I’ve posted in the past about using the 'purge' command line utility on Mac OSX to free up inactive memory but a recent update appears to have broken the tool from working. An alternative is to use the FreeMemory app from the App Store to do the same thing, but more easily. Mas is only able to install/update applications that are listed in the Mac App Store itself. Use softwareupdate(8) utility for downloading system updates (like iTunes, Xcode Command Line Tools, etc) To install all pending updates run mas upgrade.

How do you empty the trash on your Mac even when it tells you you can't? There's a Terminal trick for that!

Updated February 2017 with new information about the Terminal command for macOS Sierra.

There are a number of different reasons why your attempt to empty your Mac's trash bin might be thwarted. Maybe an item is 'still in use' even though you know it's not. Maybe an item is locked. Maybe an item has a special character that makes your Mac think it's too important to just delete. Whatever the reason, fear not. There is a way you can force your trash bin to empty for good and it can be done using Terminal.

Line

It used to be that you could force the trash to empty on your Mac using sudo rm -rf ~/.Trash/*, but it doesn't work in El Capitan or Sierra. If you are running OS X 10.10 or higher, follow these steps instead.

Note: There are keyboard shortcuts you can use force your Mac to empty the trash that you should try first. You can Control-click on an item in the trash and select Delete Immediately, or you can try holding down the Option key while emptying the trash. This Terminal trick should only be used if the other methods don't work.

How to force the trash to empty on a Mac using Terminal

  1. Use Spotlight to find and launch Terminal on your Mac.

  2. Enter the following command into terminal without hitting Enter afterward.

    sudo rm -R

    Please note that there is a space after R. Make sure you add a space after R or this command will not work.

  3. Control-click on your Trash icon to open it.

  4. Select all of the files in your trash folder.
  5. Drag the files into the Terminal window.

  6. Hit Enter.
  7. Enter your administrator password. You will not see the password being typed into Terminal. It will look like nothing has changed.
  8. Hit Enter again.

This may take a while to complete if you have a lot of large files in your trash bin.

If this command didn't work, it might be because you forgot to add a space after the R. Try the process again with a space.

Any questions?

Do you have any questions about using Terminal to force the trash bin on your Mac to empty?

Purge Command Linux

macOS Catalina

Purge Command Line

Main

We may earn a commission for purchases using our links. Learn more.

Lawsuit time

Google faces privacy lawsuit over tracking users in apps without consent

Law firm Boies Schiller Flexner has filed another lawsuit against Google. This time, the law firm has accused Google of tracking users in apps even after opting out.