trash-cli

Move files and folders to the trash

Github星跟踪图

CLI Build Status

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 delete 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> […]

  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

主要指标

概览
名称与所有者sindresorhus/trash-cli
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2015-10-13 07:06:12
推送于2025-10-10 01:31:10
最后一次提交
发布数13
最新版本名称v7.0.0 (发布于 2025-10-10 10:25:34)
第一版名称v1.0.0 (发布于 2015-10-13 14:29:16)
用户参与
星数1.4k
关注者数9
派生数37
提交数41
已启用问题?
问题数32
打开的问题数7
拉请求数4
打开的拉请求数0
关闭的拉请求数2
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?