trashy(8)

NAME
trashy - trash in the shell

SYNOPSIS
trash file1 file2...
empty [option]

DESCRIPTION

There is an unhealthy habit that arises with many a POSIX user: the careless and wreckless use of the dreaded rm command. Trashy is a helpful intermediary that intervenes when you would otherwise use rm.

trashy attempts to be compliant with the Free Desktop specification for desktop trash, meaning that you can use trashy in conjunction with a desktop environment and find your files in your desktop trash just as if you had dragged and dropped them there yourself. You can also restore the files by right-clicking and selecting `restore`, or whatever method your desktop defines for that process.

USAGE

Issue this command:

trash foo

and foo will be moved to the system trash.

At this point, you have not yet removed the file from your system, so if you wish to recover it, go and fetch it from your trash. There, now isn't that nicer than rm?

When you're really really sure that everything in your Trash wants to be nuked out of existance, then you can issue the command:

trash --empty

and your Trash will be emptied.

If there are spaces in your filenames, first of all stop using spaces in your filenames. Secondly, you must escape the space when you trash it:

trash foo\ bar

If you issue trash without any arguments, it will do nothing.

OPTIONS

-l, --list
    Lists the contents of your trash can. To also see the size of your trash, add the -v flag.

-v, --verbose
    Makes trashy verbose.

-r, --restore [FILE NAME]
    Restores a file.

-w, --version, --which
    Returns the version of trashy you are currently running. -w because -v was already taken by verbose :-)

-d, --dry-run, --dryrun
    Does not actually move or remove files, just shows what will happen if you really did.

SYSTEM TRASH LOCATIONS

On Linux, BSD, Ilumos, and Solaris, the system trash, by default, is that defined by the Free Desktop specification: ~/.local/share/Trash

If you do not use an environment that plays nice with the Free Desktop spec (ie, Mac OS) then trashy will attempt to detect and use your actual system trash.

If all else fails, a ~/.trash directory is created and used.

BUGS AND ISSUES

Things can get a little messy when you're trashing files from an external drive because trash currently moves the file from your external drive to your system harddrive. It works, but it's not as graceful as, say, creating a .trash folder on that external drive and hiding stuff there until later.

ALTERNATIVES

Trashy depends on BASH. There is a similar application called trash-cli, which is Python-based. At this point, they do mostly the same thing, but obviously if you do not run BASH or ZSH or similar, then you might prefer a Python-based solution.

SEE ALSO
rm (1)
mv (1)

AUTHORS
Klaatu (klaatu@member.fsf.org)

BUGS
Email bugs reports or fixes to klaatu@member.fsf.org