A fast multithreaded CLI tool that replaces text across files under a directory.
fastreplace walks a path (recursively), optionally filters by file suffix, and replaces all occurrences of a string with another — using a bounded worker pool for speed.
Download a prebuilt binary from the Releases page, or build from source:
git clone https://github.com/esrrhs/fastreplace.git
cd fastreplace
go build -o fastreplace .Docker:
docker pull esrrhs/fastreplaceReplace aaa with bbb in every .txt file under the current directory:
./fastreplace -path ./ -file .txt -from aaa -to bbbShow version:
./fastreplace -versionMore flags:
Usage of ./fastreplace:
-file string
file format (suffix filter, e.g. .txt)
-from string
old string
-path string
replace path (default "./")
-thread int
replace thread (default 32)
-to string
new string
-v show info
-version
show version
./pack.shCross-platform archives are written to pack/. The Release workflow watches version.go: when its version string changes on master (and the tag does not exist yet), CI runs ./pack.sh and publishes a GitHub Release.
MIT — see LICENSE.