Overview
sindresorhus/trash-cli provides a single trash command that moves files and folders to the macOS, Linux, or Windows trash/recycle bin instead of permanently deleting them with rm. The latest stable release checked on September 23, 2026 is 7.2.0.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Move paths or glob matches into the OS trash
The CLI accepts ordinary paths plus glob and negation patterns, with --verbose available to print the items moved.
Best fit
Fits interactive shell use where recoverability matters more than permanent deletion
It is useful for local terminal workflows where files should land in the system trash so they can still be restored through normal OS facilities.
Sources: [2]
Before adoption
This repository only provides trash; it does not provide list/restore/empty commands
Commands such as trash-put, trash-list, and trash-restore belong to different similarly named projects. This package only moves items to trash; restoration is handled by OS facilities and the README points to a separate empty-trash-cli for emptying trash.
alias rm=trash is convenient but not full rm compatibility
The README suggests the alias for interactive shells, but the implementation ignores several common rm flags rather than implementing their semantics. Do not substitute it in scripts that depend on exact rm behavior.
Understand shell expansion versus trash-cli globbing
Quoting patterns such as trash '*.png' lets trash-cli's globby implementation interpret the pattern. Unquoted globs can be expanded by the shell first, changing dotfile and negation behavior.
Official sources
- [1]trash-cli v7.2.0 release(2026-09-23)
- [2]trash-cli v7.2.0 README(2026-09-23)
- [3]trash-cli v7.2.0 package metadata(2026-09-23)
- [4]trash-cli v7.2.0 CLI implementation(2026-09-23)
- [5]trash-cli reviewed main(2026-09-23)
- [6]trash-cli MIT license(2026-09-23)
Supplemental curator note
This repository provides only the trash command. trash-put, trash-list, and trash-restore belong to other projects; this review corrects that prior confusion. Version 7.2.0 adds --dot for dotfile globs and requires Node 20+.
Try it in 3 steps
- 1
Install trash-cli 7.2.0 globally
Node.js 20 or newer is required.
npm install --global trash-cli@7.2.0 - 2
Create a disposable test file and move it to trash
The file is moved to the operating system trash/recycle bin rather than permanently deleted.
mkdir -p /tmp/trash-cli-demo && printf 'demo\n' >/tmp/trash-cli-demo/sample.txt && trash --verbose /tmp/trash-cli-demo/sample.txt - 3
Exercise quoted dotfile globbing
This demonstrates the 7.2.0
--dotflag. Restore through normal OS trash facilities; this CLI does not provide list/restore commands.printf 'hidden\n' >/tmp/trash-cli-demo/.hidden.tmp && trash --dot --verbose '/tmp/trash-cli-demo/*.tmp'
Growth
Growth trends · Last 30 days
1,414 Stars
+1 (+0.1%)
Development activity
Last 90 days · weekly
- Issues opened
- 0
- Issues closed
- 0
- PRs opened
- 1
- PRs merged
- 0
Issues
0 / 0
Pull requests
1 / 0
Maintenance
- Median first response
- Not specified
- Issue response rate
- No eligible issues
Based on up to the 100 newest issues opened by external users in the last 90 days. A first comment from an OWNER, MEMBER, or COLLABORATOR counts as a response; issues whose full comment history cannot be checked are excluded. The median and response rate update weekly.
Built with
Categories and tags
Categories
Tags
GitHub data
GitHub dataView detailed GitHub data
- Stars
- 1,414
- Forks
- 39
- Watchers
- 9
- Open issues
- 2
- Contributors
- 4
- Primary language
- JavaScript
- License
- MIT
- Repository last updated
- Feb 2, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Biome25,842 Stars
1 shared tag(s) · 1 shared category(s)
A Rust-based web development toolchain that combines formatting and linting for JavaScript, TypeScript, JSX, JSON, CSS, GraphQL, and related files through CLI and LSP.
Rust - Cloudflare Workers SDK4,567 Stars
1 shared tag(s) · 1 shared category(s)
Cloudflare's official monorepo for Workers developer tooling, including Wrangler, create-cloudflare (C3), and Miniflare for project creation, local development, and deployment.
TypeScript - React250,659 Stars
1 shared tag(s) · Same language
A JavaScript library for declarative web and native UI; React 19.3 stabilizes View Transitions and Fragment Refs.
JavaScript - Next.js142,408 Stars
1 shared tag(s) · Same language
Vercel's framework for building full-stack web applications by extending React.
JavaScript - Node.js122,045 Stars
1 shared tag(s) · Same language
A cross-platform JavaScript runtime for servers, CLIs, and tooling with separate Current and LTS release lines.
JavaScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.