Documentation

ruplacer – find and replace text in source files

ruplacer is a command-line tool to find and replace text in source files.

The tool walks through every file in PATH while honoring .gitignore files found on the way.

This is free and open source software.

Key Features

  • Subvert mode – an option which works across a variety of case styles (lower case, snake case, and so on):
  • Filter files by type or glob patterns – select or ignore certain “file types” or glob patterns.
  • Quiet option.
  • Implement --hidden and --ignored flags, to force patching of hidden and ignored files, respectively.
  • word-regex – option to interpret pattern as a ‘word’ regex.
  • Cross-platform support – runs under Linux, macOS, and Windows.

Website: github.com/your-tools/ruplacer
Support:
Developer: Dimitri Merejkowsky
License: BSD 3-Clause “New” or “Revised” License

ruplacer help

Examples:

Replace ‘foo’ with ‘bar’:

$ ruplacer foo bar

Replace ‘LastName, FirstName’ with ‘FirstName LastName’:

$ ruplacer '(\w+), (\w+)' '$2 $1'

Replace ‘--foo-bar‘ with ‘–spam-eggs‘. The use of ‘--‘ because the pattern and the replacement start with two dashes:

$ ruplacer -- --foo-bar --spam-eggs

Replace ‘FooBar’ with ‘SpamEggs’, ‘foo_bar’ with ‘spam_eggs’, …

$ ruplacer --subvert FooBar SpamEggs

ruplacer is written in Rust. Learn Rust with our recommended free books and free tutorials.


Related Software

Alternatives to sed
sadSpace Age seD
sdIntuitive find and replace CLI
Sed-GoImplementation of sed in Go
ruplacerFind and replace text in source files
ripgrepRecursively search directories for a regex pattern
amberCode search and replace tool
repPerform find and replace on grep-formatted lines
repgrepInteractive replacer for ripgrep
srgnCode surgeon for searching and manipulating text and source code
teipMasking tape to help commands "do one thing well"
Alternatives to awk
gawkImplementation of the awk programming language
GoAWKPOSIX-compliant awk interpreter written in Go
MillerSmall and powerful CLI tool to do all your data processing
frawkSmall programming language for writing short programs processing textual data
chooseHuman-friendly and fast alternative to cut and (sometimes) awk
gemaGeneral purpose text processing utility based on the concept of pattern matching
mawkInterpreter for the awk programming language
ruplacerFind and replace text in source files
rawkPOSIX compatible AWK written in Rust
wakawk implementation for toybox and standalone
PAWKPython line processor
HawkHaskell text processor for the command-line
Alternatives to grep
ugrepUltra fast grep with interactive - Top 100 TUI apps
ripgrepRecursively search directories for a regex pattern - Top 100 CLI apps
siftFast and powerful alternative to grep
The Silver SearcherCode-searching tool similar to ack, but faster
ackgrep-like source code search tool
CGrepContext-aware grep for source codes
ngrepgrep applied to the network layer
vgrepPager for grep, git-grep, ripgrep and similar grep implementations
xlsxgrepTool to search text in XLSX, XLS, CSV, TSV and ODS files
bingrepgrep-like tool for binaries
ucggrep-like tool specialized for searching large bodies of source code
pruPipeable Ruby
phpgrepSyntax-aware grep for PHP code
rzgrepgrep for stuff in archives that are embedded within archives
skimGeneral-purpose fuzzy finder
ruplacerFind and replace text in source files
ClapgrepGUI tool which offers ripgrep based full-text searches
repgrepInteractive replacer for ripgrep
w2vgrepSemantic grep tool
ast-grepPerforms structural search, lint and rewriting
serplTUI to search and replace keywords
grokTool like UNIX grep on steroids
osgrepNatural-language search that works like grep
hgrepgrep with human-friendly search output
mgrepSemantically grep everything
demongrepFast, local semantic code search
ckSemantic code search
ferpClone of grep, but written in modern Fortran
krepOptimized string search utility

Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments