RPL(1)

πŸ’– RPL(1) β€” the girlies' guide to search-and-replace πŸ’–

okay so bestie, listen. rpl is a User Commands girlie and she does exactly one thing but she does it so well: she searches and replaces text in files. that's her whole personality and honestly? iconic.


✨ NAME ✨

rpl β€” search and replace text in files πŸŽ€


🌸 SYNOPSIS 🌸

rpl [OPTION...] OLD-TEXT NEW-TEXT [FILE...]

πŸ¦‹ DESCRIPTION πŸ¦‹

bestie. the whole gig is: search and replace text in files. that's it, that's the vibe.

Text that matches the pattern OLD-TEXT gets swapped out for NEW-TEXT in each FILE. and the tea is: the pattern can match multiple lines, so don't even worry about it being a one-line-only situation. she's flexible. πŸ’…

  • -h, --help β€” prints the help and dips. that's it. bye πŸ‘‹
  • --full-help β€” prints the help but with the hidden options included too. secret menu energy, lowkey obsessed 🫢
  • -V, --version β€” prints the version and exits. short and sweet ✨

okay so about that pattern β€” OLD-TEXT matches at most once in each position, even when it matches the empty string. like, she's not out here double-dipping at the same spot. one match per position, periodt.

  • --encoding=ENCODING β€” specify the character set encoding. tell her what alphabet the vibe is in πŸ’œ
  • -w, --whole-words β€” whole words only (OLD-TEXT only matches on word boundaries) (default=off). partial matches? not today, bestie 🚫
  • -b, --backup β€” renames the original FILE to FILE~ before doing the replacing (default=off). little safety net moment, we love a girl who plans ahead πŸŽ€
  • -q, --quiet β€” quiet mode (default=off). she's giving mysterious, silent, unbothered 🀫
  • -v, --verbose β€” verbose mode (default=off). she's giving tell-me-EVERYTHING main character energy πŸ“£
  • -s, --dry-run β€” simulation mode (default=off). she acts like she's doing it but changes nothing. rehearsal era 🎭
  • -F, --fixed-strings β€” treats OLD-TEXT and NEW-TEXT as fixed strings, not regular expressions (default=off). no regex drama, just literal vibes πŸ’€
  • --dotall β€” lets dot (period) match any character, including newlines (default=off). the dot said "no limits" 🌈
  • --files β€” OLD-TEXT and NEW-TEXT are file names to read the patterns from (default=off). patterns from a file, fancy ✨
  • -x, --glob=GLOB β€” only modifies files matching the given glob (you can give this more than once) (default=*). picky about her circle, and honestly? valid 🌸
  • -R, --recursive β€” searches recursively (default=off). she goes deep, no cap πŸ•³οΈ
  • -p, --prompt β€” prompts you before modifying each file (default=off). always asks for consent, queen πŸ‘‘
  • -f, --force β€” ignore errors when trying to preserve attributes (default=off). mistakes? never heard of her πŸ’…
  • -d, --keep-times β€” keeps the modification times on modified files (default=off). preserving the timeline, respect πŸ•°οΈ
  • -i, --ignore-case β€” searches case-insensitively. FUNNY, funny, FuNnY β€” all the same to her πŸ™ˆ
  • -m, --match-case β€” ignores case when searching, but tries to match the case of the replacement to the case of the original, whether that's capitalized, all upper-case, or mixed. she's doing the mental math and she's right every time 🧠✨

πŸŽ€ EXAMPLES πŸŽ€

imagine wanting to replace every single occurrence of the word funny with annoying in all files with the .txt extension under the reports/ directory. the way she'd do it:

rpl --glob '*.txt' -R -w funny annoying reports

boom. slay. done. πŸ”₯


πŸ’œ AUTHOR πŸ’œ

Written by Gâran Weinholt and Reuben Thomas. two legends, one tool, we stan 🫢


Copyright Β© 2025-2026 Reuben Thomas <rrt@sc3d.org>

Licence GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

bestie the "NO WARRANTY" is in ALL CAPS for a reason okay, take it seriously 😭

🌈 SEE ALSO 🌈

find(1), sed(1) β€” her cousins, her sisters, her girls πŸ’–


and that's the whole page, babes ✨ this was rpl version 2.1.0, dated July 2026 β€” drop a πŸ’… for the devs, they ate fr fr πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from