SED(oh) LOCAL SED(oh) sed - usage and tips SUBSTITUTION replace old with new : s/old/new/ replace all occurrences : s/old/new/g replace the second occurrence : s/l/p/2 Examples $ echo "hello" | sed "s/l/p/" heplo $ echo "hello" | sed "s/l/p/g" heppo $ echo "hello" | sed "s/l/p/2" helpo path variables The typical separator is /, which can conflict with pathnames. An option is to use another character as a separtor, eg.: @ : echo "/some/path" | sed "s/\/some\/path/\/other\/directory/" echo "/some/path" | sed "s@/some/path@/other/directory@" SEE ALSO text_manipulation(oh) - OpenBSD manpages: sed(1) AUTHORS ohazot(oh) | about(oh) | ohazot.com: https://ohazot.com OpenBSD 7.7 linux| Created:2025-10-03|Updated:2025-10-21| SED(oh)