2024-06-20 00:37:02 -04:00
# gt
2024-07-30 23:06:52 -04:00
g(o)t(rash) is a simple, command line program to interface with the XDG Trash. Files in the trash may be listed, cleaned, or restored via an interactive table, and filtered with various flags.
2024-06-20 00:37:02 -04:00
2024-07-30 23:06:52 -04:00
## Interactive Mode
Run with no args to start interactive mode. In interactive mode, files in the trash are displayed, and may be selected to either restore or remove permanently.
## rm-like Trashing
Run with no command and only filename(s) as argument(s) to skip displaying files, sending them straight to the trash, in a quick, rm-like way.
## Commands
Files are displayed in an interactive table, allowing them to be sorted, filtered, and selectively operated on.
2024-06-20 00:37:02 -04:00
### trash / tr
2024-07-31 00:07:48 -04:00
2024-07-30 23:06:52 -04:00
Find files on the filesystem based on the filter flags and any filename args.
2024-06-20 00:37:02 -04:00
2024-07-31 00:07:48 -04:00
#### flags
*--recursive*, *-r*
operate on files recursively
2024-07-31 13:12:06 -04:00
*--work-dir* **dir** , *-w* **dir**
2024-07-31 00:07:48 -04:00
operate on files in this directory
*--hidden*, *-h*
operate on hidden files
2024-06-20 00:37:02 -04:00
### list / ls
2024-07-31 00:07:48 -04:00
2024-07-30 23:06:52 -04:00
Find files in the trash based on the filter flags and any filename args.
2024-06-20 00:37:02 -04:00
2024-07-31 00:07:48 -04:00
#### flags
*--non-interactive*, *-n*
list files and quit
2024-07-31 13:12:06 -04:00
*--original-path* **dir** , *-O* **dir**
2024-07-31 00:07:48 -04:00
list files trashed from this directory
2024-06-20 00:37:02 -04:00
### restore / re
2024-07-31 00:07:48 -04:00
2024-07-30 23:06:52 -04:00
Find files in the trash based on the filter flags and any filename args.
2024-06-20 00:37:02 -04:00
2024-07-31 00:07:48 -04:00
#### flags
*--all*, *-a*
2024-07-31 03:51:14 -04:00
restore all files in trash
2024-07-31 00:07:48 -04:00
2024-07-31 13:12:06 -04:00
*--original-path* **dir** , *-O* **dir**
*restore* files trashed from this directory
2024-07-31 00:07:48 -04:00
2024-06-20 00:37:02 -04:00
### clean / cl
2024-07-31 00:07:48 -04:00
2024-07-30 23:06:52 -04:00
Find files in the trash based on the filter flags and any filename args.
2024-06-20 00:37:02 -04:00
2024-07-31 00:07:48 -04:00
#### flags
*--all*, *-a*
2024-07-31 03:51:14 -04:00
clean all files in trash
2024-07-31 00:07:48 -04:00
2024-07-31 13:12:06 -04:00
*--original-path* **dir** , *-O* **dir**
2024-07-31 00:07:48 -04:00
remove files trashed from this directory
## Flags
### Global flags
*--confirm*, *-c*
ask for confirmation before executing any action
2024-07-31 13:12:06 -04:00
*--log* **level** , *-l* **level**
2024-07-31 00:07:48 -04:00
set log level
### Filter flags (usable with all commands)
2024-07-31 13:12:06 -04:00
*--match* **pattern** , *-m* **pattern**
2024-07-31 00:07:48 -04:00
operate on files matching regex pattern
2024-07-31 13:12:06 -04:00
*--glob* **pattern** , *-m* **pattern**
2024-07-31 00:07:48 -04:00
operate on files matching glob
2024-07-31 13:12:06 -04:00
*--not-match* **pattern** , *-M* **pattern**
2024-07-31 00:07:48 -04:00
operate on files not matching regex pattern
2024-07-31 13:12:06 -04:00
*--not-glob* **pattern** , *-G* **pattern**
2024-07-31 00:07:48 -04:00
operate on files not matching glob
2024-07-31 13:12:06 -04:00
*--on* **date** , *-O* **date**
2024-07-31 00:07:48 -04:00
operate on files modified on date
2024-07-31 13:12:06 -04:00
*--before* **date** , *-B* **date**
2024-07-31 00:07:48 -04:00
operate on files modified before date
2024-07-31 13:12:06 -04:00
*--after* **date** , *-A* **date**
2024-07-31 00:07:48 -04:00
operate on files modified after date
*--files-only*, *-F*
operate on files only
*--dirs-only*, *-D*
operate on directories only
2024-07-31 13:12:06 -04:00
*--min-size* **size** , *-N* **size**
2024-07-31 00:07:48 -04:00
operate on files larger than size
2024-07-31 13:12:06 -04:00
*--max-size* **size** , *-X* **size**
2024-07-31 00:07:48 -04:00
operate on files smaller than size
2024-07-31 13:12:06 -04:00
*--mode* **mode** , *-x* **mode**
2024-07-31 00:07:48 -04:00
operate on files matching mode mode
See also gt(1) or `gt --help` .
2024-07-31 00:54:22 -04:00
## Screenshots
2024-07-31 01:03:52 -04:00
![trashing screenshot ](./screenshots/Screenshot01.png )
2024-07-31 00:54:22 -04:00
2024-07-31 01:03:52 -04:00
![list screenshot ](./screenshots/Screenshot02.png )