macOS
brew install trash-clilocal Homebrew formula metadata
安装
brew install trash-clilocal Homebrew formula metadata
sudo apk add trash-cliAlpine Linux edge package indexes · trash-cli · 来源: dl-cdn.alpinelinux.org
sudo apt install trash-cliDebian stable package indexes · trash-cli · 来源: deb.debian.org
sudo dnf install trash-cliFedora Rawhide package metadata · trash-cli · 来源: dl.fedoraproject.org
nix profile install nixpkgs#trash-clinixpkgs package indexes · pkgs/by-name/tr/trash-cli/package.nix · 来源: api.github.com
sudo pacman -S trash-cliArch Linux sync databases · trash-cli · 来源: geo.mirror.pkgbuild.com
sudo zypper install trash-cliopenSUSE Tumbleweed package metadata · trash-cli · 来源: download.opensuse.org
概览
Command-line interface to the freedesktop.org trashcan
历史
trash-cli is a Python command-line interface to the freedesktop.org trash can. Its README describes a suite of commands for moving files to trash, listing trashed files, restoring them, emptying trash, and removing matching trashed entries while preserving metadata such as original path, deletion date, and permissions.
The project grew out of the Unix command-line gap between irreversible `rm` and desktop trash implementations. The official README frames trash-cli as a command-line and scripting interface to the same trash can used by KDE, GNOME, and XFCE, making desktop-style file recovery available from shells and scripts.
GitHub repository metadata identifies `andreafrancia/trash-cli` as an official source repository created in 2011, while the README examples still show older usage dates from 2007 and 2008. The project has continued to publish tagged versions and maintain Python packaging instructions, with the README recommending pipx or pip, source installs from Git, and distro package managers.
trash-cli moved from being a convenience wrapper for freedesktop.org trash semantics into a broadly packaged Unix utility. The official README lists package-manager installation commands for Debian/Ubuntu, Arch Linux, and Fedora, and the batch input additionally records availability in Homebrew, apk, Debian, dnf, MacPorts, Nix, pacman, Ubuntu, and zypper.
The package's adoption is tied to cross-desktop Linux behavior: by using the freedesktop.org trash location and metadata model, it fits systems where graphical file managers and command-line tools need to see the same trash state.
Typical use is replacing ad hoc destructive cleanup with explicit trash operations: `trash-put` sends files or directories to the trash, `trash-list` supports shell filtering, `trash-restore` interactively restores entries, `trash-empty` clears trash or old entries, and `trash-rm` removes trashed files matching patterns.
The README explicitly warns against aliasing `rm` directly to `trash-put` because the commands have different semantics, including directory handling. Instead it suggests using shell aliases that remind users not to run `rm`, and it documents cron-based automatic deletion with `trash-empty 30`.
For package-manager users, trash-cli is the portable Linux answer to safer deletion from scripts and terminals. It matters because it integrates with the desktop trash standard rather than inventing a private holding directory, so it can be packaged once and behave consistently across common Unix desktops.
The formula is also a good example of a small CLI whose executable surface is intentionally split into subcommands, making it easy for downstream packagers and shell users to expose focused tools instead of one large interactive program.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
trash-empty | cli | 全局可执行文件 | |
trash-list | cli | 全局可执行文件 | |
trash-put | cli | 全局可执行文件 | |
trash-restore | cli | 全局可执行文件 | |
trash-rm | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/andreafrancia/trash-cli
安装元数据
| 软件包键 | brew:trash-cli |
|---|---|
| 版本 | 0.24.5.26 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/trash-cli |
| 主页 | https://github.com/andreafrancia/trash-cli |
| 仓库 | https://github.com/andreafrancia/trash-cli |
| 上游文档 | https://github.com/andreafrancia/trash-cli#readme |
| 许可证 | GPL-2.0-or-later |
| 源码归档 | https://files.pythonhosted.org/packages/f7/6c/d51b36377c35e4f9e69af4d8b61a920f26251483cdc0165f5513da7aefeb/trash_cli-0.24.5.26.tar.gz |
| 依赖 | python@3.14 |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | trash-cli |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Conflicts With |
|
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | yes |
| URL Keys |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
trash-cli 0.24.5.26-0.3
command line trashcan utility
https://github.com/andreafrancia/trash-cli
sudo apt install trash-clitrash-cli
nix profile install nixpkgs#trash-clitrash-cli 0.23.11.10-1
command line trashcan utility
https://github.com/andreafrancia/trash-cli
sudo apt install trash-clitrash-cli 0.24.5.26-r1
Command line interface to the freedesktop.org trashcan
https://github.com/andreafrancia/trash-cli
sudo apk add trash-clitrash-cli-doc 0.24.5.26-r1
Command line interface to the freedesktop.org trashcan (documentation)
https://github.com/andreafrancia/trash-cli
sudo apk add trash-cli-doctrash-cli-pyc 0.24.5.26-r1
Precompiled Python bytecode for trash-cli
https://github.com/andreafrancia/trash-cli
sudo apk add trash-cli-pyctrash-cli 0.24.5.26-20.fc45
Command line interface to the freedesktop.org trashcan
https://github.com/andreafrancia/trash-cli
sudo dnf install trash-clitrash-cli 0.24.5.26-3
Command line trashcan (recycle bin) interface
https://github.com/andreafrancia/trash-cli
sudo pacman -S trash-clitrash-cli 0.24.5.26-1.4
Command line interface to the freedesktop.org trashcan
https://github.com/andreafrancia/trash-cli
sudo zypper install trash-cli来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.