frep

December 6, 2025 · View on GitHub

frep is a fast find-and-replace tool. Search and replace in files in a directory (including subdirectories), or process stdin.

Warning

This project is deprecated. You can use scooter with the --no-tui flag instead - for example:

# Instead of:
frep "before" "after"

# Use:
scooter -N -s "before" -r "after"

When specifying a directory:

# Instead of:
frep --directory ./src/dir "before" "after"

# Use:
scooter -N -s "before" -r "after" ./src/dir

Run scooter --help to see all flags.

Usage

Files

To replace text in files within the current directory:

frep "before" "after"

Or specify an alternative directory:

frep --directory ./src/dir "before" "after"

Stdin

To process text from stdin:

$ echo "hello world" | frep "hello" "hi"
hi world

Options

There are a number of command-line flags to change the behaviour of frep, such as:

  • --fixed-strings (-f) to search without regex
  • --advanced-regex (-a) to use advanced regex features such as negative lookahead (not enabled by default for improved performance)
  • --include-files (-I) and --exclude-files (-E) to include or exclude files and directories using glob matching. For instance, -I "*.rs, *.py" matches all files with the .rs or .py extensions, and -E "env/**" excludes all files in the env directory
  • --case-insensitive (-i) to ignore case when matching
  • --match-whole-word (-w) to only match complete words

Run frep --help to see the full list of flags.

Note: When processing stdin, the --include-files, --exclude-files, and --hidden flags are not available as they are file-system specific.

Performance

frep is fast. Below is a benchmark for comparison, performing a find and replace across the entire Linux kernel repo, finding and replacing the string "before" with "after":

CommandMean [s]Min [s]Max [s]Relative
frep4.402 ± 0.0324.3634.4461.00 ± 0.03
ripgrep + sd4.916 ± 0.1304.7925.1221.12 ± 0.04
fastmod4.398 ± 0.1094.2194.4931.00
fd + sd10.011 ± 0.00010.01010.0112.28 ± 0.06

Installation

Homebrew

On macOS and Linux, you can install frep using Homebrew:

brew install thomasschafer/tap/frep

Prebuilt binaries

Download the appropriate binary for your system from the releases page:

PlatformArchitectureDownload file
LinuxIntel/AMD*-x86_64-unknown-linux-musl.tar.gz
LinuxARM64*-aarch64-unknown-linux-musl.tar.gz
macOSApple Silicon*-aarch64-apple-darwin.tar.gz
macOSIntel*-x86_64-apple-darwin.tar.gz
Windowsx64*-x86_64-pc-windows-msvc.zip

After downloading, extract the binary and move it to a directory in your PATH.

Cargo

Ensure you have cargo installed (see here), then run:

cargo install frep

Building from source

Ensure you have cargo installed (see here), then run the following commands:

git clone git@github.com:thomasschafer/frep.git
cd frep
cargo install --path frep --locked