{"id":15628384,"url":"https://github.com/phrozenbyte/rmtrash","last_synced_at":"2025-04-06T17:13:25.072Z","repository":{"id":12205134,"uuid":"14810987","full_name":"PhrozenByte/rmtrash","owner":"PhrozenByte","description":"Put files (and directories) in trash using the `trash-put` command in a way that is, otherwise as `trash-put` itself, compatible to GNUs `rm` and `rmdir`","archived":false,"fork":false,"pushed_at":"2023-09-02T08:58:37.000Z","size":105,"stargazers_count":325,"open_issues_count":2,"forks_count":27,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-30T15:11:21.039Z","etag":null,"topics":["rm","rmtrash","shell","trash","trash-files","trashcan"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhrozenByte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-11-29T22:02:49.000Z","updated_at":"2025-03-12T13:19:46.000Z","dependencies_parsed_at":"2024-10-23T00:36:51.878Z","dependency_job_id":null,"html_url":"https://github.com/PhrozenByte/rmtrash","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhrozenByte%2Frmtrash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhrozenByte%2Frmtrash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhrozenByte%2Frmtrash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhrozenByte%2Frmtrash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhrozenByte","download_url":"https://codeload.github.com/PhrozenByte/rmtrash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247517921,"owners_count":20951719,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rm","rmtrash","shell","trash","trash-files","trashcan"],"created_at":"2024-10-03T10:22:21.030Z","updated_at":"2025-04-06T17:13:25.053Z","avatar_url":"https://github.com/PhrozenByte.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"rmtrash 1.15\n============\n\nPut files (and directories) in trash using the ```trash-put``` command from [trash-cli](https://github.com/andreafrancia/trash-cli), in a way that (unlike ```trash-put``` itself) is compatible with GNU's ```rm``` and ```rmdir```.\n\nInstallation\n------------\n\nJust download both scriptfiles (```rmtrash``` and ```rmdirtrash```) and put them in ```/usr/local/bin```. If you're using Arch Linux, you can also use the [AUR package](https://aur.archlinux.org/packages/rmtrash/). On macOS, you must install the `gnu-getopt` and `coreutils` packages using Homebrew.\n\nIf you don't want to readjust the usage of ```rm``` and ```rmdir```, a bash alias is probably a great solution for you. Just add the lines\n\n```\nalias rm='rmtrash'\nalias rmdir='rmdirtrash'\nalias sudo='sudo '\n```\n\nto your ```~/.bashrc``` (or ```~/.bash_aliases```). Consider adding the ```--forbid-root``` option (see *replacement option* below)! The last line is optional, without you'll notice that ```rmtrash``` and ```rmdirtrash``` won't be called when using ```sudo```.\n\nRequirements\n------------\n\nObviously  [```trash-cli```](https://github.com/andreafrancia/trash-cli) (to provide the ```trash-put``` or ```trash``` command) is required. ```rmtrash``` and ```rmdirtrash``` *should* work great with any distribution. If ```rmtrash``` or ```rmdirtrash``` doesn't work with your favourite distribution, please file a bug report. It was written to work with ```bash```.\n\n**You wanna make ```rmtrash``` and ```rmdirtrash``` work with your favorite distribution or improve them in general?** Go on, I appreciate it!\n\nUsage of rmtrash\n----------------\n\n```shell\nrmtrash [OPTION]... [FILE...]\n```\n\n```rmtrash``` supports everything that GNU's ```rm``` does, that means it accepts the following options (see ```--help```):\n\n* Help options:\n  * ```--help```: display help and exit\n  * ```--version```: output version information and exit\n\n* Application options:\n  * ```-f```, ```--force```: ignore nonexistent files, never prompt\n  * ```-i```: prompt before every removal\n  * ```-I```: prompt once before removing more than three files, or when removing recursively. Less intrusive than ```-i```, while still giving protection against most mistakes\n  * ```--interactive[=WHEN]```: prompt according to WHEN: ```never```, ```once``` (```-I```), or ```always``` (```-i```). Without WHEN, prompt always\n  * ```--one-file-system```: when removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument\n  * ```--no-preserve-root```: do not treat ```/``` specially\n  * ```--preserve-root```: do not remove ```/``` (default)\n  * ```-d```, ```--dir```: remove empty directories\n  * ```-r```, ```-R```, ```--recursive```: remove directories and their contents recursively\n  * ```-v```, ```--verbose```: explain what is being done\n\nUsage of rmdirtrash\n-------------------\n\n```shell\nrmdirtrash [OPTION]... [DIRECTORY...]\n```\n\n```rmdirtrash``` supports everything that GNU's ```rmdir``` does, that means it accepts the following options (see ```--help```):\n* Help options:\n  * ```--help```: display help and exit\n  * ```--version```: output version information and exit\n\n* Application options:\n  * ```--ignore-fail-on-non-empty```: ignore each failure that is solely because a directory is non-empty\n  * ```-p```, ```--parents```: remove DIRECTORY and its ancestors; e.g., ```rmdirtrash -p a/b/c``` is similar to ```rmdirtrash a/b/c a/b a```\n  * ```-v```, ```--verbose```: output a diagnostic for every directory processed\n\nReplacement option\n------------------\n\nThis option is not supposed to be used when calling ```rmtrash``` resp. ```rmdirtrash```. It helps you to control how and in which cases ```rm``` resp. ```rmdir``` are replaced. Without ```--forbid-root```, ```root``` isn't treated specially.\n\n* ```--forbid-root[=HOW]```: forbid user ```root``` to trash files.  When standard input is a terminal, ```ask-forbid``` and ```ask-pass``` will question the user to pass the command to ```/bin/rm```. When standard input is no terminal, ```ask-forbid``` will abort the command, whereas ```ask-pass``` will pass the command to ```/bin/rm```. Use ```pass``` to pass all commands of user ```root``` to ```/bin/rm``` without a query. If user ```root``` should never trash files, use ```always```. In contrast, ```never``` treats ```root``` in no special way. Without ```HOW```, ```ask-forbid``` is assumed\n\nAdditional Notes\n----------------\n\nFor additional information, see the ```trash-list``` (or ```list-trash```), ```trash-empty``` (or ```empty-trash```), ```trash-restore``` (or ```restore-trash```) and ```trash-rm``` commands provided by [```trash-cli```](https://github.com/andreafrancia/trash-cli), as well as the [FreeDesktop.org Trash Specification](http://www.ramendik.ru/docs/trashspec.html). Note ```trash-put --help``` (or ```trash --help```) and ```rm --help```, too.\n\n**A important note about execution time:**\n```rmtrash``` is pretty slow! Because we're indexing all containing files before actually building the trash command (and because it's just a shell script), it is pretty slow when trashing many files. If you want to remove a very large directory (in terms of *many files*), consider using ```trash-put``` or ```rm``` directly. **Never** name ```rmtrash```s scriptfile ```rm``` - this will replace ```rm``` and is definitly not what you actually want! Use a bash alias as described above. The same applies to ```rmdirtrash```.\n\nTypically you won't notice a time delay when using ```rmtrash``` and ```rmdirtrash```, but now you know that there is a time delay...\n\nLicense \u0026 Copyright\n-------------------\n\nCopyright (C) 2011-2023  Daniel Rudolf \u003chttps://www.daniel-rudolf.de/\u003e\n\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License only.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the [GNU General Public License](LICENSE) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrozenbyte%2Frmtrash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphrozenbyte%2Frmtrash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphrozenbyte%2Frmtrash/lists"}