-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrash.1
65 lines (65 loc) · 1.8 KB
/
trash.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
.Dd September 26, 2022
.Dt TRASH 1
.Os
.Sh NAME
.Nm trash ,
.Nm untrash
.Nd move files to the trash can, and restore them
.Sh SYNOPSIS
.Nm trash
.Ar file ...
.Nm untrash
.Ar file ...
.Sh DESCRIPTION
.Nm trash
moves one or more files or directories to a directory called trash can,
with a unique name resembling its original name;
and creates a file containing information on where the file came from and
the time it was moved to the trash can.
.Pp
.Nm untrash
moves one or more files or directory from a directory called trash can
to the directory it originally was before being moved to the trash can
by
.Nm trash .
.Po
In order to know where a trashed file came from,
.Nm trash
creates an information file with such information.
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm trash
and
.Nm untrash :
.Bl -tag -width Ds
.It Ev TRASH
The directory containing the trash can for the partition of the user.
If not set, defaults to
.Pa "~/.local/share/Trash" .
.Sh FILES
The trash directory is created with the proper permissions the first time
.Nm trash
is used.
It contains two subdirectories called
.Pa "$TRASH/files/"
and
.Pa "$TRASH/info/" .
.Bl -tag -width Ds
.It Pa "$TRASH/files/*"
This directory contains the files and directories that were trashed.
When a file or directory is trashed, it is moved into this directory.
Each file has a unique name equal to its original name plus a unique number.
.It Pa "$TRASH/info/*.trashinfo"
This directory contains an
.Dq "information file"
for every file and directory in
.Pa "$TRASH/files/" .
Each information file has exactly the same name as the corresponding
file or directory in
.Pa "$TRASH/files/" ,
plus the extension
.Dq "trashinfo"
Each information file contains the original name of the trashed file
and the time it was trashed.
.Sh SEE ALSO
.Xr rm 1