Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

trash-cli

> 编程语言
Open source

Move files and folders to the trash

1.4K stars0 likes1 views
WebsiteGitHub

About

Move files and folders to the trash

trash-cli

Move files and folders to the trash

Works on macOS (10.12+), Linux, and Windows (8+).

In contrast to rm which is dangerous and permanently deletes files, this only moves them to the trash, which is much safer and reversible. I would also recommend reading my guide on safeguarding rm.

Accepts paths and glob patterns.

Install

bash
npm install --global trash-cli

Usage

$ trash --help

  Usage
    $ trash <path|glob> […]

  Options
    --dot          Match dotfiles when using glob patterns (remember to quote the glob)
    --verbose, -v  Print trashed items

  Examples
    $ trash unicorn.png rainbow.png
    $ trash '*.png' '!unicorn.png'

Tip

Add alias rm=trash to your .zshrc/.bashrc to reduce typing & safely trash files: $ rm unicorn.png.

FAQ

Related

  • trash - API for this package
  • empty-trash-cli - Empty the trash
  • del-cli - Delete files and folders

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言