Last Updated: February 25, 2016
·
367
· willnew

A smarter way to empty Trash on your MAC

Have you ever got some troubles on empty Trash like these?

There's always a popup when I take this action

Can not empty my Trash because some files are running/locked

You can easily solve these problems by entering codes below in your Terminal:

rm -rf ~/.Trash/*

To make it easier to call, you can add this function in you .bash_profile, .zshrc etc. then the function in terminal by its name :

function cleartrash() {
    rm -rf ~/.Trash/*
}

If you are an advocate of shell script, you can also make this a shell script:

#!/bin/bash
rm -rf ~/.Trash/*

It's easy, but helpful to me.