Empty Mac OS Trash.

I was trying to empty my Mac Trash with Empty Securely option available with Finder,
Emptying the trash in OS X Finder can be a long process, especially If you have lots of items (like me). This is after some minutes.

Screen Shot 2015-08-09 at 11.29.05 PM

Solution 1:
Check to see that “Empty trash securely” is not set. This erases files multiple times, so it takes much longer to delete.

The setting is in Finder’s Preferences on the Advanced page. I’ve heard that sometimes a Snow Leopard upgrade accidentally sets this option.

Solution 2:

If you do it through the Terminal it is nearly always considerably faster:

rm -rf .Trash/*

Screen Shot 2015-08-09 at 11.25.06 PM

However it can be noted that this won’t delete files that appear in your Trash from external hard drives, other partitions, etc. Those files are stored at /Volumes/NAME_OF_DEVICE/.Trashes/USER_ID where USER_ID is your user ID. (Usually 501 on a single user system) and you’ll have to remove them using a second command. (sudo rm -rf /Volumes/*/.Trashes/501/* should do all of them for you)

As always when using rm -rf be completely sure the path you’ve typed into the Terminal is correct or you’re liable to delete much more than you mean to. (eg. a space before a * is never good)

As to why the Finder takes so long, the Finder does some extra work of deleting files from all the devices attached to a computer, overriding permissions if necessary (using a subprocess called Locum), file stats, among others.

———————————————————————————————————————————————————————————————-

rm: Remove files

-f          Attempt to remove the files without prompting for confirma-
tion, regardless of the file’s permissions.  If the file does
not exist, do not display a diagnostic message or modify the
exit status to reflect an error.
-R          Attempt to remove the file hierarchy rooted in each file
argument.  The -R option implies the -d option.  If the -i
option is specified, the user is prompted for confirmation
before each directory’s contents are processed (as well as
before the attempt is made to remove the directory).  If the
user does not respond affirmatively, the file hierarchy
rooted in that directory is skipped.

-r          Equivalent to -R.

———————————————————————————————————————————————————————————————–

Get more info about rm command by using info rm command in terminal.

To know other linux commands check https://proudgeekk.wordpress.com/2013/12/23/some-common-linux-commands/