1 | # trash-cli
|
2 |
|
3 | > Move files and folders to the trash
|
4 |
|
5 | Works on macOS (10.12+), Linux, and Windows (8+).
|
6 |
|
7 | In contrast to [`rm`](http://en.wikipedia.org/wiki/Rm_(Unix)) which is [dangerous](http://docstore.mik.ua/orelly/unix3/upt/ch14_03.htm) 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`](https://github.com/sindresorhus/guides/blob/main/how-not-to-rm-yourself.md#safeguard-rm).
|
8 |
|
9 | Accepts paths and [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
10 |
|
11 | ## Install
|
12 |
|
13 | ```sh
|
14 | npm install --global trash-cli
|
15 | ```
|
16 |
|
17 | ## Usage
|
18 |
|
19 | ```
|
20 | $ trash --help
|
21 |
|
22 | Usage
|
23 | $ trash <path|glob> […]
|
24 |
|
25 | Examples
|
26 | $ trash unicorn.png rainbow.png
|
27 | $ trash '*.png' '!unicorn.png'
|
28 | ```
|
29 |
|
30 | ## Tip
|
31 |
|
32 | Add `alias rm=trash` to your `.zshrc`/`.bashrc` to reduce typing & safely trash files: `$ rm unicorn.png`.
|
33 |
|
34 | ## [FAQ](https://github.com/sindresorhus/trash#faq)
|
35 |
|
36 | ## Related
|
37 |
|
38 | - [trash](https://github.com/sindresorhus/trash) - API for this package
|
39 | - [empty-trash-cli](https://github.com/sindresorhus/empty-trash-cli) - Empty the trash
|
40 | - [del-cli](https://github.com/sindresorhus/del-cli) - Delete files and folders
|