trash-cli

Move files and folders to the trash

MIT 16 个版本
安装
npm install trash-cli
yarn add trash-cli
pnpm add trash-cli
bun add trash-cli
README

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

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

版本列表
7.2.0 2026-02-02
7.1.1 2026-01-26
7.1.0 2026-01-25
7.0.0 2025-10-10
6.0.0 2024-07-26
5.0.0 2021-11-21
4.0.0 2020-11-20
3.1.0 2020-08-04
3.0.0 2019-05-29
2.0.0 2019-04-18
1.4.0 2016-09-23
1.3.0 2016-04-08
1.2.1 2016-02-23
1.2.0 2015-11-04
1.1.0 2015-10-14
1.0.0 2015-10-13