{"id":24319529,"url":"https://github.com/ryym/rnm","last_synced_at":"2025-09-27T04:31:25.548Z","repository":{"id":57619600,"uuid":"66188395","full_name":"ryym/rnm","owner":"ryym","description":"Batch rename files and folders, recursively","archived":false,"fork":false,"pushed_at":"2017-06-22T14:44:54.000Z","size":24,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T12:47:59.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/ryym.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}},"created_at":"2016-08-21T08:20:01.000Z","updated_at":"2024-06-06T15:34:35.000Z","dependencies_parsed_at":"2022-09-26T18:10:50.012Z","dependency_job_id":null,"html_url":"https://github.com/ryym/rnm","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/ryym%2Frnm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryym%2Frnm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryym%2Frnm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryym%2Frnm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryym","download_url":"https://codeload.github.com/ryym/rnm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234384574,"owners_count":18823698,"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":[],"created_at":"2025-01-17T15:33:40.113Z","updated_at":"2025-09-27T04:31:25.275Z","avatar_url":"https://github.com/ryym.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rnm\n\n[![travis][travis-badge]](https://travis-ci.org/ryym/rnm)\n\n[travis-badge]: https://travis-ci.org/ryym/rnm.svg?branch=travis\n\nBatch rename files and folders.\n\n**Note that this project is a Go implementation of [75lb/renamer](https://github.com/75lb/renamer)**\nand most of the README contents are copied from the original repository.\n\n## Install\n\n```sh\n$ go get github.com/ryym/rnm/cmd/rnm\n```\n\n## Usage\n\n```sh\n$ rnm [options] \u003cfiles\u003e\n```\n\n### -f, --find \u0026lt;string\u0026gt;\n\nThe find string, or regular expression when `--regex` is set. If not set, the whole filename will be replaced.\n\n### -r, --replace \u0026lt;string\u0026gt;\n\nThe replace string. With `--regex` set, `--replace` can reference parenthesised substrings from `--find` with $1, $2, $3 etc. If omitted, defaults to a blank\n\n### -e, --regex\n\nWhen set, --find is intepreted as a regular expression.\n\n### -d, --dry-run\n\nUsed for test runs. Set this to do everything but rename the file.\n\n**Don't forget to test your rename first using `--dry-run`!**\n\n## Examples\n\nSome real-world examples.\n\n**Windows users**: the single-quotation marks used in the example commands below are for bash (Mac/Linux) users, please replace these with double-quotation marks on Windows.\n\n### Simple replace\n\n```sh\n$ rnm --find '[bad]' --replace '[good]' *\n```\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\u003cth\u003eBefore\u003c/th\u003e\u003cth\u003eAfter\u003c/th\u003e\u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── A poem [bad].txt\n├── A story [bad].txt\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── A poem [good].txt\n├── A story [good].txt\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Strip out unwanted text\n\n```sh\n$ rnm --find 'Season 1 - ' *\n```\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\u003cth\u003eBefore\u003c/th\u003e\u003cth\u003eAfter\u003c/th\u003e\u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── Season 1 - Some crappy episode.mp4\n├── Season 1 - Load of bollocks.mp4\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── Some crappy episode.mp4\n├── Load of bollocks.mp4\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Simple filename cleanup\n\n```sh\n$ rnm --regex --find '.*_(\\d+)_.*' --replace 'Video $1.mp4' *\n```\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\u003cth\u003eBefore\u003c/th\u003e\u003cth\u003eAfter\u003c/th\u003e\u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── [ag]_Annoying_filename_-_3_[38881CD1].mp4\n├── [ag]_Annoying_filename_-_34_[38881CD1].mp4\n├── [ag]_Annoying_filename_-_53_[38881CD1].mp4\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── Video 3.mp4\n├── Video 34.mp4\n├── Video 53.mp4\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### if not already done, add your name to a load of files\n```sh\n$ rnm --regex --find '(data\\d)(\\.\\w+)' --replace '$1 (checked by Lloyd)$2' *\n```\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\u003cth\u003eBefore\u003c/th\u003e\u003cth\u003eAfter\u003c/th\u003e\u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── data1.csv\n├── data2 (checked by Lloyd).csv\n├── data3.xls\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── data1 (checked by Lloyd).csv\n├── data2 (checked by Lloyd).csv\n├── data3 (checked by Lloyd).xls\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### rename files and folders, recursively\n\n```sh\n$ rnm --find 'pic' --replace 'photo' '**/*'\n```\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\u003cth\u003eBefore\u003c/th\u003e\u003cth\u003eAfter\u003c/th\u003e\u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── pic1.jpg\n├── pic2.jpg\n└── pics\n    ├── pic3.jpg\n    └── pic4.jpg\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── photo1.jpg\n├── photo2.jpg\n└── photos\n    ├── photo3.jpg\n    └── photo4.jpg\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### prefix files and folders, recursively\n\n```sh\n$ rnm --regex --find '^' --replace 'good-' '**/*'\n```\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\u003cth\u003eBefore\u003c/th\u003e\u003cth\u003eAfter\u003c/th\u003e\u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── pic1.jpg\n├── pic2.jpg\n└── pics\n    ├── pic3.jpg\n    └── pic4.jpg\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n            \u003ctd\u003e\u003cpre\u003e\u003ccode\u003e.\n├── good-pic1.jpg\n├── good-pic2.jpg\n└── good-pics\n    ├── good-pic3.jpg\n    └── good-pic4.jpg\n            \u003c/code\u003e\u003c/pre\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryym%2Frnm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryym%2Frnm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryym%2Frnm/lists"}