RMW(1)

NAME
rmw - ReMove to Waste - Move (mv) FILE(s) to a designated Waste folder or Desktop Trash

SYNOPSIS
rmw [OPTION]...[FILE]...

DESCRIPTION
ReMove to Waste (rmw) is a bash script which functions as a command line recycle bin/trash can utility. Optionally, it can ReMove files to Desktop trash and has been tested on GNOME, KDE, and Xfce. It features quick and easy restoration from the command line and duplication protection.

OPTIONS
-t <file(s)> Desktop Trash will not be used

-d <file(s)>
    files will be ReMoved to Desktop Trash

-g  select desktop trash folder from list

-w  select console waste folder from list

-u  undo last ReMove

-s  Select a file to restore; displays list

-z <file(s)>
    Restore file(s). Accepts base file name or full path to Waste directory. Not for use when desktop trash is enabled

-2  show disk usage for Waste folder

-9  permanently delete Waste folder

-a  generate auto-clean script

-v <file(s)>
    be verbose (quiet mode needs work)

-V  display version

Examples: rmw -z temp foobar (restore two files)

    rmw -z ~/.Waste/files/ab* rmw -sz ~/Alternate-Waste/files/*

    (select waste folder, then restore files)

DETAILED INFORMATION

CONSOLE WASTE
By default, rmw will move files to ~/.Waste/files and write an info file to
    ~/.Waste/info for each file. The info file contains the original file name, absolute path, and a date string (date +%s). The date string is used during cleaning mode to determine if the file should be purged.

If you use rmw on a file that has the same name as one already in your console waste, a date string (date +%H%M%S-%y%m%d) will be appended to the file you're moving. The file already in your console waste will be unchanged.

If Desktop Trash is enabled in rmwrc (see RMWRC below), it can be overridden from the command line by using -t and therefore console waste will be used.

DESKTOP TRASH
If Desktop Trash is enabled (see RMWRC), files will be moved to $DesktopTrashFolder/files
    and a .trashinfo file will be written. The .trashinfo is the same format used by common Desktop environments (KDE, GNOME, Xfce), and therefore the file can be restored using the Trash folder from your Desktop.

If Desktop Trash is enabled in rmwrc, user need not use -d at the command line.

If you use rmw on a file that has the same name as one already in your Desktop Trash, a date string be appended to the file you're moving. The file already in your Desktop Trash will be unchanged.

Normally when you delete a file from the KDE desktop, a small file (trashrc) is written
    which tells KDE the trash is not empty. And when you empty the trash KDE updates the trashrc.

[Status]
    Empty=true

When you use rmw with Desktop Trash enabled, trashrc is created containing:

[Status]
    Empty=false

If you don't use KDE or if trashrc is not present on your system, this file will be ignored.

If your Desktop doesn't have a $DesktopTrashFolder/info directory, .trashinfo files will not be written. If clean_mode is set to 0 (in rmwrc), these checks won't happen.

CLEAN MODE

Once per day, rmw will search .rmw info files in all Alt_Waste folders (see rmwrc) to see if any files are past their expiration date (days=x in rmwrc). Other options for cleaning are in rmwrc. When rmw -a is used, nothing is deleted, but a script is generated and a user can see what files would get permanently deleted if rmw performed an actual clean.

FOLDER SELECTION

Normally the mv command (which rmw calls) is very fast at moving files, however, when mv'ing a file/dir from one filesystem to another, mv copies and then deletes, which can take a long time depending on file size and number of files.
    When used with the -w or -g, a selection menu is presented to direct where the waste will go. The directories in the list must be specified by the user (Alt_Waste or Alt_DTF in rmwrc, see "Automatic Folder Selection" below).

Your Waste folder can also be specified on the command line.
    WASTE=$HOME/junk rmw

DesktopTrashFolder=/mnt/sda6/.Trash-1001 rmw
    Desktop Trash folder shouldn't be changed unless you know what you're doing and how your GUI handles Trash on different filesystems and partitions. Use the open discussion forum on the rmw sourceforge project page to possibly get more information about this.

If waste or desktop folder selection (-w, -g) is enabled, it will be ignored.

The folder you specify at the command line will be created automatically if it doesn't exist and provided you have write acess. If you specify $HOME/junk, the folders $HOME/junk/files and $HOME/junk/info will be created.

AUTOMATIC FOLDER SELECTION

Your Alt_Waste (Alternate Waste) and Alt_DTF (Alternate Desktop Trash) folders need to be specified in rmwrc. rmw can automatically select the Waste folder based on the filesystem on which the file you're ReMoving resides. This feature ( which depends on "stat," a command most likely already installed on your system), and can be enabled in rmwrc (auto_chg_waste). With this enabled, rmw will ignore any folders selected by -w, $sel_waste, or folder specified at the command line. Not for use with Desktop Trash (yet).

RMWRC

The configuration file for rmw is by default ~/.rmw/rmwrc. All the options are documented with comments. This file is automatically generated by rmw when it is first run.

RESTORING

rmw will not attempt to restore from Desktop Trash.

rmw -z will accept a base file name or the absolute path to a console Waste directory. If you have more than one Waste directory, use -w to select which Waste folder you wish to restore from. When supplying only the base file name, wildcards can't be used. rmw will look in your selected Waste folder for the exact file name, and prepend the absolute path automatically. However, if the user specifies the path to his Waste directory, wild cards can be used. (ex. rmw -zw ~/.Waste/files/*). Make sure when the selection menu is displayed, you select ~/.Waste as your folder, or no files will be found.

Options -s and -w can be combined. At this time, only one file at a time can be restore using -s.

BUGS
rmw is available for beta testing and for end-users. No critical bugs reported yet. Bug reports can be made at the rmw sourceforge project page or by emailing the Author (see below).

LICENSE
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
rm(1), mv(1), date(1), stat(1)

AUTHOR
Andy Alt andyqwerty@users.sourceforge.net

HOMEPAGE
<http://rmw.sf.net/>

This man page last updated June 23, 2011