https://github.com/thealgorythm/frs
Rename files with RegEx patterns.
https://github.com/thealgorythm/frs
cli developer-tools find regex rename rename-directories rename-files rust rust-lang
Last synced: 7 months ago
JSON representation
Rename files with RegEx patterns.
- Host: GitHub
- URL: https://github.com/thealgorythm/frs
- Owner: TheAlgorythm
- License: gpl-3.0
- Created: 2021-02-10T09:58:40.000Z (over 4 years ago)
- Default Branch: MAIN
- Last Pushed: 2023-09-21T08:53:47.000Z (about 2 years ago)
- Last Synced: 2025-03-18T03:51:31.703Z (7 months ago)
- Topics: cli, developer-tools, find, regex, rename, rename-directories, rename-files, rust, rust-lang
- Language: Rust
- Homepage: https://zschoen.dev/projects/frs
- Size: 442 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# File Rename Search

[](https://github.com/TheAlgorythm/frs/actions?query=workflow%3ARust)
[](https://crates.io/crates/frs)
[](https://web.crev.dev/rust-reviews/crate/frs/)Rename files with RegEx patterns.

## Usage
```zsh
$ frs --helpUSAGE:
frs [FLAGS] [OPTIONS] [base-path]FLAGS:
-i, --case-insensetive
-c, --continue-on-error
-d, --directory Rename all matching directories. If no type is set, then everything will be renamed
-n, --dry-run This is the default and lets you run it without the actual operation
-f, --file Rename all matching files. If no type is set, then everything will be renamed
-h, --help Prints help information
-r, --run Actually running the rename operation. If you want to set this as default, set the
environment variable `FRS_DEFAULT_OP` to `RUN`
-s, --symlink Rename all matching symlinks. If no type is set, then everything will be renamed
-T, --traverse-tree This traverses the Directory Tree. If set, the renaming of directories will be disabled
by default, to prevent the renaming of a directory and its inner files
-V, --version Prints version information
-v, --verbose Set the verbosity. In a dry-run its automatically set to 1OPTIONS:
-I, --icons [env: FRS_SHOW_ICONS=] [default: true]ARGS:
[default: .]
```### Example
```zsh
$ frs -f '([a-z]+)_(\d+)(\..+)' '${2}_${1}${3}' test_folder
test_folder/bar_02.png -> test_folder/02_bar.png
test_folder/foo_01.txt -> test_folder/01_foo.txt
```## Installation
### Cargo
Please check, that you have a recent version of Rust installed.
```zsh
$ cargo install frs
```## Setup
### Operation Mode
The default operation is to do a dry-run. To change this behavior, you have to set the `FRS_DEFAULT_OP` environment variable to `RUN`.
### Icons

frs is able to show [Nerd Font](https://www.nerdfonts.com/) icons. If you don't use NF in your terminal you can disable it with the `--icons` option or with the `FRS_SHOW_ICONS` environment variable.
This can be done e.g. on ZSH by adding this line to your ~/.zshenv:```zsh
export FRS_SHOW_ICONS=false
```## CREV - Rust code reviews - Raise awareness
Please, spread this info !\
Open source code needs a community effort to express trustworthiness.\
Start with reading the reviews of the crates you use. Example: [web.crev.dev/rust-reviews/crate/num-traits/](https://web.crev.dev/rust-reviews/crate/num-traits/) \
Than install the CLI [cargo-crev](https://github.com/crev-dev/cargo-crev)\. Read the [Getting Started guide](https://github.com/crev-dev/cargo-crev/blob/master/cargo-crev/src/doc/getting_started.md). \
On your Rust project, verify the trustworthiness of all dependencies, including transient dependencies with `cargo crev verify`\
Write a new review ! \
Describe the crates you trust. Or warn about the crate versions you think are dangerous.\
Help other developers, inform them and share your opinion.\
Use the helper on this webpage: [web.crev.dev/rust-reviews/review_new](https://web.crev.dev/rust-reviews/review_new)