https://github.com/zapturk/frfn
Find and Replace File Name
https://github.com/zapturk/frfn
Last synced: 3 months ago
JSON representation
Find and Replace File Name
- Host: GitHub
- URL: https://github.com/zapturk/frfn
- Owner: zapturk
- License: mit
- Created: 2024-09-13T12:52:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-26T22:05:29.000Z (8 months ago)
- Last Synced: 2025-09-26T23:26:41.597Z (8 months ago)
- Language: Go
- Size: 28.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Find and Replace File Name
This is a simple CLI tool to find and replace text in the file name in the current directry.
Install
==================
- Install Go
- Add the Go bin folder to your path
- Run this in your terminal
```
go install github.com/zapturk/frfn@latest
```
```
go install github.com/zapturk/frfn@v1.0.0
```
Usage
==================
This tool has three main commands: `replace`, `prepend`, and `append`.
### Replace
The `replace` command (aliased as `r`) finds and replaces text within file names in the current directory.
**Options:**
* `--OldText`, `-o`: (Required) The text to be replaced in the file name.
* `--NewText`, `-n`: (Required) The new text to replace the old text.
* `--Force`, `-f`: (Optional) By default, the command runs in a "dry run" mode, showing the changes without applying them. Use this flag to execute the file renaming.
**Example:**
To replace "old" with "new" in file names:
```bash
frfn replace -o "old" -n "new"
```
To execute the replacement:
```bash
frfn replace -o "old" -n "new" -f
```
### Prepend
The `prepend` command (aliased as `p`) adds text to the beginning of file names in the current directory.
**Options:**
* `--Text`, `-t`: (Required) The text to prepend to the file names.
* `--Force`, `-f`: (Optional) By default, the command runs in a "dry run" mode. Use this flag to execute the file renaming.
**Example:**
To prepend "prefix-" to all file names:
```bash
frfn prepend -t "prefix-"
```
To execute the prepending:
```bash
frfn prepend -t "prefix-" -f
```
### Append
The `append` command (aliased as `a`) adds text to the end of file names in the current directory.
**Options:**
* `--Text`, `-t`: (Required) The text to append to the file names.
* `--Force`, `-f`: (Optional) By default, the command runs in a "dry run" mode. Use this flag to execute the file renaming.
**Example:**
To append "-suffix" to all file names:
```bash
frfn append -t "-suffix"
```
To execute the appending:
```bash
frfn append -t "-suffix" -f
```