Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/trash-cli
Move files and folders to the trash
https://github.com/sindresorhus/trash-cli
Last synced: 27 days ago
JSON representation
Move files and folders to the trash
- Host: GitHub
- URL: https://github.com/sindresorhus/trash-cli
- Owner: sindresorhus
- License: mit
- Created: 2015-10-13T07:06:12.000Z (about 9 years ago)
- Default Branch: main
- Last Pushed: 2023-06-21T00:31:08.000Z (over 1 year ago)
- Last Synced: 2024-04-14T10:28:45.787Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 22.5 KB
- Stars: 1,279
- Watchers: 11
- Forks: 39
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- orm-awesome - trash-cli
- jimsghstars - sindresorhus/trash-cli - Move files and folders to the trash (JavaScript)
README
# trash-cli
> Move files and folders to the trash
Works on macOS (10.12+), Linux, and Windows (8+).
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).
Accepts paths and [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
## Install
```sh
npm install --global trash-cli
```## Usage
```
$ trash --helpUsage
$ trash […]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](https://github.com/sindresorhus/trash#faq)
## Related
- [trash](https://github.com/sindresorhus/trash) - API for this package
- [empty-trash-cli](https://github.com/sindresorhus/empty-trash-cli) - Empty the trash
- [del-cli](https://github.com/sindresorhus/del-cli) - Delete files and folders