← Files Unix CopilotARCHIVED FILE

references/text-processing.md

702 Bytes · Nov 7, 2026 · 12:49 UTC

↓ Download file

See the change to this file →

# Text search and transformation

Clarify exact match versus regular expression, locale, case sensitivity and input encoding. `grep` defaults to basic regex; `grep -E` uses extended. GNU `sed` and BSD `sed` differ in in-place syntax; prefer output-to-new-file for portability.

Use `find ... -exec` with arbitrary filenames, and avoid parsing `ls`. Grep/ripgrep options depend on versions and package availability. Treat binary files, NUL bytes, CRLF and UTF-8 carefully. Replacements should be staged and diffed.

Primary: POSIX utilities https://pubs.opengroup.org/onlinepubs/9799919799/ ; GNU grep https://www.gnu.org/software/grep/manual/ ; GNU sed https://www.gnu.org/software/sed/manual/sed.html

SHA-256: 2cb1137d5f2d90b270673bc7e70d1c32a677bda38ce3f171924fa08eb70f8b01