Other Pages

Other Software/Code by Me

Unmaintained Software

trash icon


This is a small command-line program for OS X that moves files or folders to the trash.

By default, trash asks Finder to move the specified files/folders to the trash instead of calling the system API to do this because of the "put back" feature that only works when trashing files through Finder. If you compile trash by running the command make USE_SYSTEM_API=1 the generated build will always first try the system API and only call on Finder to trash files the user lacks access rights for. See my blog post for more info on some initial implementation details and design decisions.


Here's the usage info of this program (run it without any arguments to see this):

usage: trash [-ulesv] <file> [<file> ...]

  Move files/folders to the trash.

  Options to use with <file>:

  -v  Be verbose (show files as they are trashed, or if
      used with the -l option, show additional information
      about the trash contents)

  Stand-alone options (to use without <file>):

  -u  Check for updates (and optionally auto-update self)
  -l  List items currently in the trash (add the -v option
      to see additional information)
  -e  Empty the trash (asks for confirmation)
  -s  Securely empty the trash (asks for confirmation)

Version 0.8.2
Copyright (c) 2010 Ali Rantakari, http://hasseg.org/trash

Source code is available in a Git repository (click here to show/hide):

Latest Version:

Version 0.8.2      →    Download
January 22, 2012


  • Sizes of folders in the trash are now calculated recursively when the -l and -v arguments are used (and we will thus show the total size of the files in the trash).
  • Dropped PowerPC support in the pre-built binary (I'm now using the XCode 4 dev tools, which do not support PowerPC anymore).
  • Clarified the use of 'stand-alone' arguments in the usage output.

Older Versions:

Show/hide older versions
Latest Version (0.8.2):

Copyright © 2010 Ali Rantakari