andreafrancia/trash-cli is one of the server-side repositories TopGit tracks, currently at 4.5k stars, written primarily in Python. Command line interface to the freedesktop.org trashcan.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
trash-cli - Command Line Interface to FreeDesktop.org Trash
|Downloads|
|Donate|_
简体中文_
trash-cli trashes files recording the original path, deletion date, and
permissions. It uses the same trashcan used by KDE, GNOME, and XFCE, but you
can invoke it from the command line (and scripts).
It provides these commands::
trash-put trash files and directories.
trash-empty empty the trashcan(s).
trash-list list trashed files.
trash-restore restore a trashed file.
trash-rm remove individual files from the trashcan.
Note: you need to use quotes in order to protect the pattern from shell expansion.
FAQ
How to create a top level .Trash dir?
Steps ::
sudo mkdir --parent /.Trash
sudo chmod a+rw /.Trash
sudo chmod +t /.Trash
Can I alias `rm` to `trash-put`?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can but you shouldn't. In the early days I thought it was a good idea to do
that but now I changed my mind.
Although the interface of `trash-put` seems to be compatible with `rm`, it has
different semantics which will cause you problems. For example, while `rm`
requires `-R` for deleting directories `trash-put` does not.
But sometimes I forget to use `trash-put`, really can't I?
You could alias rm to something that will remind you to not use it::
alias rm='echo "This is not the command you are looking for."; false'
Then, if you really want to use rm, simply prepend a backslash to bypass the
alias::
\rm file-without-hope
Note that Bash aliases are used only in interactive shells, so using
this alias should not interfere with scripts that expect to use rm.
Where do the trashed files go?
File trashed from the home partition will be moved here::
~/.local/share/Trash/
How to auto delete files older than 30 days?
This will update your crontab file with a trash-empty command that runs daily
and removes files older than 30 days. To review your crontab use: crontab -l
Installation
The easy way
Requirements:
* Python 3 (Python 2.7 also works)
* pipx_ (optional, to install in a clean environment)
If pipx is available::
pipx install trash-cli
Alternatively, install with vanilla pip::
pip install trash-cli
Note: you may want to add ~/.local/bin to the PATH::
echo 'export PATH="$PATH":~/.local/bin' >> ~/.bashrc
source ~/.bashrc # reload .bashrc
For uninstalling use::
pipx uninstall trash-cli
or::
pip uninstall trash-cli
Bleeding Edge (from sources)
First of all you need to uninstall any previous version of trash-cli::
$ [sudo] pip uninstall trash-cli # remove the previous version (with pip)
$ [sudo] apt-get remove trash-cli # remove the previous version (with apt)
$ [sudo] yum uninstall trash-cli # remove the previous version (with yum)
$ ... # refer to the package manager of your distribution
How active is development on andreafrancia/trash-cli?
The most recent commit recorded on andreafrancia/trash-cli was 11 days ago, based on the GitHub push timestamp. The repository has 207 forks — one of the better signals of community interest.
How many stars does andreafrancia/trash-cli have?
andreafrancia/trash-cli has 4.5k GitHub stars — refresh the page for the live number, or check github.com/andreafrancia/trash-cli. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is andreafrancia/trash-cli open source?
Yes — andreafrancia/trash-cli ships under the GPL-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/andreafrancia/trash-cli.
What else is in the Backend space?
andreafrancia/trash-cli is tracked by TopGit under the Backend category, alongside 3 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is andreafrancia/trash-cli?
andreafrancia/trash-cli (andreafrancia/trash-cli) is a Python project on GitHub. From the project's own README: Command line interface to the freedesktop.org trashcan.
What language is andreafrancia/trash-cli written in?
andreafrancia/trash-cli is written primarily in Python. GitHub's language field is based on the largest share of bytes in the default branch.
What license does andreafrancia/trash-cli use?
andreafrancia/trash-cli is released under the GPL-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about andreafrancia/trash-cli?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/andreafrancia/trash-cli is the definitive source.
Read full README in the tab above.
Still deciding about trash-cli?
One click hands the question to an AI along with this page — see what it says about trash-cli.