Install the complete package with local command reference and every published mode.
install replacereplaceUse
Start with a command such as .bak copy is useful before a bulk change.
replace <old> <new> [path] [options]replace <old> <new>preview replacements in files of the current directory
replace <old> <new> <file>preview replacements in one file
replace <old> <new> <dir> -rpreview replacements recursively inside a directory
-wwrite the planned changes atomically
-imatch plain text without case sensitivity
-ptreat <old> as a complete PHP regular expression
-e <exts>limit extensions, for example php,js,css or tar.gz
-g <glob>limit basenames with a glob such as *.php
-bcreate .bak copies before writing
-ainclude vendor, node_modules, VCS and cache directories
Without a path, the current directory is used. A directory is scanned only at its top level unless -r is present. -e <exts> filters by extension and -g <glob> by basename. Common dependency, VCS and cache directories are skipped unless -a is explicit; symbolic links are never processed.
Preview is the default and reports how many replacements would occur in each matching file. Repeat the same command with -w to write. -b creates a .bak copy first and stops if that backup already exists. -i applies to plain-text matching; -p expects a complete PHP regular expression including delimiters.
At most 5000 files are scanned in one run, files larger than 4 MiB and binary files are skipped, and at most 500 changed files are listed in the report. Writes use a temporary file and rename so a successful replacement does not leave a partially written target.
Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.
Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.
Base and Minimum are two packages of the same current module release, not separate command versions.
Install the complete package with local command reference and every published mode.
install replaceInstall the reduced package. Local reference is omitted;
install replace -mInstall exactly this published version.
install replace -v 1.1.4Ask upgrade to check compatibility and replace the installed block only when needed.
upgrade replaceRemove the extension block while leaving the core and unrelated modules intact.
install replace -uExamples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.
cd \sandbox | replace beta "beta reviewed" workspace/original.txtPreview workspace/original.txt
Files 1
Matches 1
Would write 1replace alpha omega workspace/original.txt -wWrite workspace/original.txt
Files 1
Replaced 1replace ALPHA omega workspace/original.txt -iPreview workspace/original.txt
Case insensitive
Matches 1
Would write 1replace "~beta.*~" "beta" workspace/original.txt -pPreview workspace/original.txt
Mode regex
Matches 1
Would write 1replace debug false config -r -e iniPreview config
Extensions ini
Files 1
Matches 1
Would write 1replace alpha omega workspace -r -g "*.txt"Preview workspace
Mask *.txt
Files 3
Matches 2
Would write 2replace debug false config -r -w -bWrite config
Files 2
Replaced 2
Backups 2replace vendor_name package_name . -r -aPreview .
Hidden included
Matches 1
Would write 1replace absent present missing.txtFile not found: missing.txtsandbox/workspace/replace.txtThe example uses a file or directory from the protected /sandbox/ documentation workspace.
status=draft
owner=lil
status=draft
Clarifies that