trash-cli
Move files and folders to the trash
Last updated a year ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install trash-cli 
SYNC missed versions from official npm registry.

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

Related

Current Tags

  • 7.2.0                                ...           latest (10 months ago)

16 Versions

  • 7.2.0                                ...           10 months ago
  • 7.1.1                                ...           10 months ago
  • 7.1.0                                ...           10 months ago
  • 7.0.0                                ...           a year ago
  • 6.0.0                                ...           2 years ago
  • 5.0.0                                ...           5 years ago
  • 4.0.0                                ...           6 years ago
  • 3.1.0                                ...           6 years ago
  • 3.0.0                                ...           7 years ago
  • 2.0.0                                ...           8 years ago
  • 1.4.0                                ...           10 years ago
  • 1.3.0                                ...           11 years ago
  • 1.2.1                                ...           11 years ago
  • 1.2.0                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 39
Today 0
This Week 0
This Month 19
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (5)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE