Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robenkleene/ren-find
https://github.com/robenkleene/ren-find
Last synced: 22 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/robenkleene/ren-find
- Owner: robenkleene
- License: mit
- Created: 2023-06-25T19:13:25.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-01-11T18:09:33.000Z (5 months ago)
- Last Synced: 2024-05-12T06:42:36.329Z (about 1 month ago)
- Language: Rust
- Size: 7.37 MB
- Stars: 59
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- cli-apps - Ren - Ren is a command-line utility that takes find-formatted lines via standard input, and batch renames them. (<a name="file-renamer"></a>File renamers)
- awesome-cli-apps - Ren - Ren is a command-line utility that takes find-formatted lines via standard input, and batch renames them. (<a name="file-renamer"></a>File renamers)
README
# Ren
`ren` is a command-line utility that takes [`find`](https://en.wikipedia.org/wiki/Find_(Unix))-formatted lines via standard input, and batch renames them. By default, it outputs a [`diff`](https://en.wikipedia.org/wiki/Diff)-preview of the renamed files and directories to standard output, and with a flag it can rename the files and directories.
[![Rename with `ren`](ren.gif)](https://youtu.be/d-UhiHyWnGQ)
## Example
Output a diff to standard output showing the result of finding all the files containing `foo` in their name, and replacing `foo` to `bar` in their names:
```
find . -name '*foo*' | ren foo bar
```Add the `-w` (`--write`) flag to rename the files:
```
find . -name '*foo*' | ren foo bar
```## Installation
`ren` is available via [`cargo`](https://github.com/rust-lang/cargo):
```
cargo install ren-find
```
## ConfigurationThe default pager is `less`, the `REN_PAGER` environment variable can be used to override the pager (e.g., `export REN_PAGER=delta` in Bash).
## Help
`ren -h` (or `ren --help`, the full `--help` provides slightly longer explanations of some option) will list help for all the command-line flags.
## Acknowledgements
- Much of the functionality, and the overall structure of the source code, was borrowed [`sd`](https://github.com/chmln/sd). `ren` began as a fork of `sd`.
- The code for specifying a custom pager for `ren` was borrowed from [`delta`](https://github.com/dandavison/delta).