openbsd-ports/sysutils/trash-d/files/trash.1

140 lines
4.6 KiB
Groff

.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "TRASH" "1" "July 2022" "" ""
.
.SH "NAME"
\fBtrash\fR \- A near drop\-in replacement for \fBrm\fR that uses the trash bin
.
.P
\fBNote:\fR The name of this software is "trash\-d" however its executable is simply called \fB\fBtrash\fR\fR\. This manual favors the latter, but the two should be considered interchangable\.
.
.SH "SYNOPSIS"
trash [\fIoption\fR]\.\.\. \fIfile\fR\.\.\.
.
.SH "DESCRIPTION"
A near drop\-in replacement for \fB\fBrm\fR\fR(1) that uses the FreeDesktop trash bin\. Written in the D programming language using only D\'s Phobos standard library\.
.
.P
The options and flags are intended to mirror \fB\fBrm\fR\fR\'s closely, with some additional long options for the \fB\fBtrash\fR\fR specific features\.
.
.SS "Options"
.
.TP
\fB\fB\-d\fR\fR, \fB\fB\-\-dir\fR\fR
Remove empty directories\.
.
.TP
\fB\fB\-r\fR\fR, \fB\fB\-R\fR\fR, \fB\fB\-\-recursive\fR\fR
Delete directories and their contents\.
.
.TP
\fB\fB\-v\fR\fR, \fB\fB\-\-verbose\fR\fR
Print more information\.
.
.TP
\fB\fB\-i\fR\fR, \fB\fB\-\-interactive\fR\fR
Ask before each deletion\.
.
.TP
\fB\fB\-I\fR\fR, \fB\fB\-\-interact\-once\fR\fR
Ask before deleting 3 or more files, or deleting recursively
.
.TP
\fB\fB\-f\fR\fR, \fB\fB\-\-force\fR\fR
Don\'t prompt and ignore errors\.
.
.TP
\fB\fB\-\-version\fR\fR
Output the version and exit\.
.
.TP
\fB\fB\-\-list\fR\fR
List out the files in the trash\.
.
.TP
\fB\fB\-\-orphans\fR\fR
List orphaned files in the trash\.
.
.TP
\fB\fB\-\-delete\fR\fR \fIfile\fR
Delete a file from the trash\.
.
.TP
\fB\fB\-\-restore\fR\fR \fIfile\fR
Restore a file from the trash\.
.
.TP
\fB\fB\-\-empty\fR\fR
Empty the trash bin\.
.
.TP
\fB\fB\-\-rm\fR\fR \fIfiles\fR\.\.\.
Escape hatch to permanently delete a file\.
.
.TP
\fB\fB\-h\fR\fR, \fB\fB\-\-help\fR\fR
This help information\.
.
.SS "Precedence"
The \fB\fB\-\-help\fR\fR, \fB\fB\-\-version\fR\fR, \fB\fB\-\-list\fR\fR, \fB\fB\-\-orphans\fR\fR, \fB\fB\-\-restore\fR\fR, \fB\fB\-\-delete\fR\fR, and \fB\fB\-\-empty\fR\fR flags all cause the program to short\-circuit and perform only that operation and no others\. Their precedence is in that order exactly, and is intended to cause the least destruction\.
.
.P
Therefore the command \'\fBtrash \-\-empty \-\-list\fR\' will list the trash bin and NOT empty it\.
.
.P
\fBNote:\fR Before version 11 trash\-d followed a slightly incorrect precedence order\.
.
.SS "Compatibility with rm(1)"
One of trash\-d\'s primary goals is near compatibility with the GNU \fB\fBrm(1)\fR\fR tool\. The keyword here is "near"\. The goal is not exact flag\-for\-flag compatibility with \fB\fBrm\fR\fR, but you should be able to \'\fBalias rm=trash\fR\' and not notice the difference\. But since \fB\fBrm\fR\fR has different failure states and error messages it can never be 100% compatible\.
.
.P
Additionally since there are a few different implementations of \fB\fBrm(1)\fR\fR (BSDs and so on) that are all subtly incompatible with each other I can\'t guarantee compatibility with all versions\.
.
.P
As of version 16 unknown options will throw an error\. Prior to version 16 unknown options were silently ignored\.
.
.P
As of version 17 trash\-d will not follow symlinks recursively through directories\. This may in some cases be inconsistent with \fB\fBrm\fR\fR but errs on the side of not deleting your files\.
.
.SH "ENVIRONMENT"
.
.TP
\fB\fBXDG_DATA_HOME\fR\fR
This variable is used to determine where the default trash directory is for this user as per the FreeDesktop specification\.
.
.TP
\fB\fBTRASH_D_DIR\fR\fR
Override the trash directory to the specified path, useful for trashing on removable devices\.
.
.SH "FILES"
.
.TP
\fB\fB$XDG_DATA_HOME/Trash\fR\fR
Standard location of trash files and metadata as per the FreeDesktop specification\. Used in the absence of \fB\fB$TRASH_D_DIR\fR\fR\.
.
.TP
\fB\fB~/\.local/share/Trash\fR\fR
The fallback path used in the absence of both \fB\fB$XDG_DATA_HOME\fR\fR and \fB\fB$TRASH_D_DIR\fR\fR\.
.
.SH "EXIT STATUS"
\fB\fBtrash\fR\fR exits with the status code 0 on success, and >0 if an error occurs\.
.
.SH "SEE ALSO"
\fB\fBrm\fR\fR(1), \fB\fBuser\-dirs\.conf\fR\fR(5)
.
.SH "STANDARDS"
By mimicking \fBrm\fR this utility is partially POSIX compliant however this is \fBNOT\fR to be relied upon for any purpose\.
.
.P
trash\-d is compliant with the FreeDesktop trash specification: https://specifications\.freedesktop\.org/trash\-spec/trashspec\-latest\.html
.
.SH "AUTHOR"
Steven vanZyl \fIrushsteve1@rushsteve1\.us\fR
.
.P
The up\-to\-date sources can be found at: https://github\.com/rushsteve1/trash\-d
.
.SH "BUGS"
https://github\.com/rushsteve1/trash\-d/issues