rmv - remove files and directories, with a trash can
rmv [OPTIONS]... FILES...
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
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.
ignore nonexistent files, never prompt
prompt before any removal
remove the contents of directories recursively
explain what is being done
display this help text and exit
output version information and settings, then exit
permanently remove files, bypassing the trash can (just like rm).
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.
note: --option "value" will work just as well as the forms below.
do not back up files matching the perl regular expression /pttn/
use path as the trash can
set the maximum age for emptying by date to days
set the maximum size for the trash can to kb kilobytes
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.
specify cmd as the command for changing permissions (with chmod style arguments) on a file
specify cmd as the command for finding the date (specify the date format this way)
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).
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.
Gregory A. Marton http://csail.mit.edu/~gremio/
with valuable input from Deniz Yuret