About
A non-interactive stream editor. It applies substitutions, deletions and insertions to text as it flows past. That makes it the standard way to rewrite one pattern across many lines or files without opening an editor.
Install it
pkg install sed
Run this inside Termux. If the package is already present, pkg will say so and
do nothing.
Commands worth knowing
6 of the invocations you will actually reach for. Tap the copy button to put one on your clipboard.
sed s/http/https/g config.txt Replace every occurrence of a pattern on each line with another value. sed -i "s/localhost/127.0.0.1/g" app.conf Rewrite matches directly in the given path, not on screen. sed -n "5,10p" notes.txt Suppress the default output and print only lines five through ten. sed /^$/d app.log Delete every blank line from the stream. sed s/^[ ]*// data.txt Strip leading spaces and tabs from the start of each line. sed -n "/ERROR/=" app.log Print only the line numbers of lines matching a pattern. Worked example
Run sed s/http/https/g config.txt and this is what you should see.
$ sed s/http/https/g config.txt
base_url = https://example.com/api
mirror = https://example.org
retries = 3 Developed by
GNU Project .