TEXT_MANIPULATION(oh) LOCAL TEXT_MANIPULATION(oh) text manipulation - tools sed(oh) : text stream editor, commonly used for substitution. cut(oh) : split string. tr(oh) : translate characters. paste(oh) : join files/lines. SED 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 CUT -d | delimeter -c | split by character count -d | split by character (specify delimeter) -f | specify field count. Use n,-n,n- -f 2, gets 2nd field; -f -2, gets up to the 2nd field; -f 2-, gets from the 2nd field to the end $ echo "a b c" | cut -d " " -f 2 b $ echo "a b c" | cut -d " " -f 2- b c $ echo hello | cut -c 2 e TR $ echo "hello" | tr "l" "m" hemmo control chacters echo "hello" | tr 'e' '\n' h llo echo 'hello' | tr 'l' '\t' he o character range echo 'hello' | tr 'h-l' 'a-d' aeddo Character classes echo '1.hello\n2.goodbye' | tr '[:digit:]' 'a-c' b.hello c.goodbye PASTE Requires a file OpenBSD, cat be a pipe redirection on Slackware. OpenBSD $ cat test.log 1 2 3 $ paste -s -d "+" test.log 1+2+3 cat test.log | paste -s -d + 1+2+3 TODO - review and improve if needed. SEE ALSO openbsd(oh) , slackware(oh) AUTHORS ohazot(oh) | about(oh) | ohazot.com: https://ohazot.com Created:2025-10-03|Updated:2025-10-21| TEXT_MANIPULATION(oh)