NAME

rmv - remove files and directories, with a trash can


SYNOPSIS

rmv [OPTIONS]... FILES...


DESCRIPTION

rmv is intended to replace GNU rm for the average user. It attempts to mimic and extend GNU rm's functionality and interface.

By default, rmv does not remove directories. If a file is not writeable, and the standard input is a tty, and the -f or --force option has not been specified, then rmv will prompt the user about removing the file anyway.

rmv, like every program that uses Getopt::Long to parse its arguments, lets you use the -- option to indicate that all following arguments are non-options. To remove a file called '-f' in the current directory, you could type either

     rmv -- -f
or
     rmv ./-f


OPTIONS

All options may be specified on the command line, or in an rcfile in the form option=value

${\w+} will be replaced from the environment if possible.

Options will be read from rmvrc in /etc/skel, /etc/profile, or /etc, or from ~/.rmvrc. Options given on the command line will override any of these. For options without apparent values, set them to 1 or 0 for on or off respectively in the rcfile.

options similar to GNU rm's:

-f, --force

ignore nonexistent files, never prompt

-i, --interactive

prompt before any removal

-r, -R, --recursive

remove the contents of directories recursively

-v, --verbose

explain what is being done

-h, --help

display this help text and exit

--version

output version information and settings, then exit

additional features:

-k, --kill

permanently remove files, bypassing the trash can (just like rm).

-e, --empty

empty the trash can.

By default, this cleans out trash more than max_age (see below) old. you can specify --empty=all to clear out all the trash, or --empty=by_size to clear out the oldest trash first, until the trash can is less than max_size (see below) kilobytes

I recommend an rmv --empty either in your .login, or as a cron job.

settings:

note: --option "value" will work just as well as the forms below.

--junk=pttn

do not back up files matching the perl regular expression /pttn/

--trashcan=path

use path as the trash can

--max_age=days

set the maximum age for emptying by date to days

--max_size=kb

set the maximum size for the trash can to kb kilobytes

--copy=cmd

specify cmd as the command for copying files. The %1 in the command will be substituted by the source filename and %2 by the destination. This way you can even tar things and so on. If either is not present, first %1 then %2 will be appended. Use of double quotes around filenames is highly recommended to prevent problems with strange filenames. Double quotes inside each filename will be escaped.

--chmod=cmd

specify cmd as the command for changing permissions (with chmod style arguments) on a file

--date=cmd

specify cmd as the command for finding the date (specify the date format this way)

--mkdir=cmd

specify cmd as the command for creating a directory, and possibly parent directories as well. %1 in the command will be substituted by the directory to create, and will be appended if not present. See --copy as well. This expects that each nonexistant directory in the file path will be created all at once (gnu mkdir -p behavior).


BUGS

Root cannot use rmv because of huge gaping security holes like executing arbitrary code read from a config file! If somebody wants to make this taint compliant, please let me know. I think root would be the one *most* helped by this functionality.


AUTHOR

Gregory A. Marton http://csail.mit.edu/~gremio/

with valuable input from Deniz Yuret


Download

This program is distributed under the GNU General Public License: http://www.gnu.org/copyleft/gpl.html
The source: http://csail.mit.edu/~gremio/code/rmv.pl