{"id":17279816,"url":"https://github.com/darrenklein/trash","last_synced_at":"2026-05-15T20:01:42.303Z","repository":{"id":93685817,"uuid":"154852535","full_name":"darrenklein/trash","owner":"darrenklein","description":"Bash script for moving files and directories to the trash.","archived":false,"fork":false,"pushed_at":"2019-02-17T00:16:28.000Z","size":51,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T02:45:51.315Z","etag":null,"topics":["bash","bash-script","trash"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darrenklein.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-10-26T15:06:26.000Z","updated_at":"2019-02-17T00:14:03.000Z","dependencies_parsed_at":"2023-03-07T15:30:30.714Z","dependency_job_id":null,"html_url":"https://github.com/darrenklein/trash","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/darrenklein/trash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenklein%2Ftrash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenklein%2Ftrash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenklein%2Ftrash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenklein%2Ftrash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darrenklein","download_url":"https://codeload.github.com/darrenklein/trash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrenklein%2Ftrash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272793018,"owners_count":24993830,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bash","bash-script","trash"],"created_at":"2024-10-15T09:18:41.822Z","updated_at":"2026-05-15T20:01:37.284Z","avatar_url":"https://github.com/darrenklein.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# trash\n\u003e A safe alternative to `rm` \u0026 `rmdir` for **macOS** (and maybe more)\n\nAs many folks know, `rm` and `rmdir` can be dangerous because of the fact that they hard-delete files and directories, rather than sending them to the trash bin - **trash** is my take on a remedy for this \"problem\", moving files and folders into the trash bin instead.\n\nIf you move two files named `index.html` into the trash, the default macOS behavior is to rename the second file by inserting the 12-hour clock time of the move prior to the extension - so `index.html` will become `index 3:42 PM.html`, etc.; a duplicate directory or a file without a type extension will have the time appended to its name - `scripts` will become `scripts 3:42 PM`.\n\nI've also included my own twist, for the rare (but possible!) situation where you might want to move multiple items with the same name to the trash from different locations. In those instances, an additional trailing number will be appended to allow for unique identification. For example, running\n\n```bash\ntrash index.html test_1/index.html test_2/index.html test_3/index.html\n```\n\nwill result in the following trash content:\n\n```\nindex.html\nindex 3:45 PM.html\nindex 3:45 PM.html (1)\nindex 3:45 PM.html (2)\n```\n\n## Installation\n\nInstall this script from the cloned Github repo:\n\n- Clone the repo\n\n```bash\ngit clone https://github.com/darrenklein/trash\n```\n\n- `cd` into the clone\n\n```bash\ncd trash\n```\n\n- Run the installation script\n\n```bash\nsh ./install.sh\n```\n\n**trash** will be installed to `usr/local/bin/trash`.\n\nMake sure `usr/local/bin` is in your bash `$PATH`!\n\n## Uninstallation\n\nFrom within a local copy of the **trash** git repo, you can uninstall the script by running\n\n```bash\nsh ./uninstall.sh\n```\n\nor you can just delete the file at `usr/local/bin/trash` directly.\n\n## Use\n\nThe `trash` command can be followed by any number of files/directories that you wish to move to the trash bin. For example:\n\n```bash\ntrash index.html src scripts README.md\n```\n\n## Big ups\n\nThanks to Alexander Epstein - https://github.com/alexanderepstein - whose **BashSnippets** helped to guide the structure of this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarrenklein%2Ftrash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarrenklein%2Ftrash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarrenklein%2Ftrash/lists"}