{"id":16228434,"url":"https://github.com/nateshmbhat/rm-trash","last_synced_at":"2025-03-19T13:31:21.861Z","repository":{"id":97187918,"uuid":"156643758","full_name":"nateshmbhat/rm-trash","owner":"nateshmbhat","description":"A \"rm-trash\" is meant to be used in place of rm system command in linux . This script will safely delete your files and put them in the trash for later retrieval.","archived":false,"fork":false,"pushed_at":"2018-11-20T13:45:37.000Z","size":78,"stargazers_count":47,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T07:38:04.956Z","etag":null,"topics":["command-line-tool","delete","linux","remove","rm","rm-trash","trash","trash-rm","ubuntu","utility"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nateshmbhat.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}},"created_at":"2018-11-08T03:16:28.000Z","updated_at":"2025-03-15T09:13:00.000Z","dependencies_parsed_at":"2024-01-07T21:02:20.151Z","dependency_job_id":"95b1e47f-e3b2-4f0f-95e0-78a0daa0020d","html_url":"https://github.com/nateshmbhat/rm-trash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nateshmbhat%2Frm-trash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nateshmbhat%2Frm-trash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nateshmbhat%2Frm-trash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nateshmbhat%2Frm-trash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nateshmbhat","download_url":"https://codeload.github.com/nateshmbhat/rm-trash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244434809,"owners_count":20452263,"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":["command-line-tool","delete","linux","remove","rm","rm-trash","trash","trash-rm","ubuntu","utility"],"created_at":"2024-10-10T12:55:21.200Z","updated_at":"2025-03-19T13:31:21.575Z","avatar_url":"https://github.com/nateshmbhat.png","language":"Shell","funding_links":[],"categories":["\u003ca name=\"rm\"\u003e\u003c/a\u003eFile deletion and trash bin (alternatives to rm)"],"sub_categories":[],"readme":"# rm-trash\n\"rm-trash\" utility puts the files you delete in a shell safely into the Trash (Recycle bin). The script is meant to be used in place of rm system command in linux .\n\nThis solves accidental removals. This utility is meant to be used as an alias with rm directly and unlike other such scripts , it can handle duplicate files in the trash and works for recursive arguments and any other options that rm supports. This is a wrapper around rm and thus supports all options of rm. \n\n### Features :\n+ Meant to be used in place of `rm`\n+ Handles all arguments that rm can take\n+ If the deletion was unsuccessful because of wrong arguments , then it deletes the trashed files to save space.\n+ Handles the file name collisions with the files already in trash\n+ Handles some permission issues automatically\n+ If rm is called from any other script or indirectly then the system 'rm' command is used automatically\n+ Shows the appropriate error messages exactly like those which arise in `rm` \n\n\u003cbr\u003e\n\n\n### How It Works :\nIt first gets the arguments that you would specify for `rm` command and then if the files have right permissions then saves the files in the trash with the required meta data about it. After saving , it gives the file for deletion to `rm` with the given options.\n\nIf deletion of was unsuccesful for some reason , it deletes back the saved file or folder from the trash to save space.   \n\n\n\u003cbr\u003e\n\n## Installation :\n\n```bash\nsudo add-apt-repository ppa:nateshmbhat/rm-trash\nsudo apt-get update\nsudo apt-get install rm-trash\n```\n+ \n    **(Optional step) Its recommended to set an alias to \"rm-trash\" for easier access to the command  :**\n\n    Append the below lines to  `~/.bash_aliases` file to set alias when the shell starts\n\n    ```bash\n    alias \"trash\"=\"rm-trash\"\n    # or \n    alias \"del\"=\"rm-trash\"\n    ```\n\n## Usage :\n\nUsage is just like we use the rm command normally and supports all options of rm.\n\n```\nrm-trash filename foldername -r\n```\nNow it shows your filename in the Trash which can then be easily restored to any desired location.\n\n\n**Options :**\n\n```\n--no-trash : no trash option .\n```\nAdd this option to the command to prevent it from putting the files to trash. Useful when you want to remove huge amount of files and sizes.\n\n```\nrm-trash folder/ -r --no-trash\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnateshmbhat%2Frm-trash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnateshmbhat%2Frm-trash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnateshmbhat%2Frm-trash/lists"}