TEXT_PROCESSING(oh) LOCAL TEXT_PROCESSING(oh) text processing - tools sed(oh) : text stream editor, commonly used for substitution. cut(oh) : split string. tr(oh) : translate characters. paste(oh) : join files/lines. awk : pattern processing language. 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 on OpenBSD, cat be a pipe redirection on Slackware. OpenBSD $ cat test.log 1 2 3 $ paste -s -d "+" test.log 1+2+3 Slackware cat test.log | paste -s -d + 1+2+3 head head : Get first 10 lines of file : head FILENAME head -15 : Get first 15 lines of file : head -15 FILENAME tail tail : Get last 10 lines of file : tail FILENAME tail -15 : Get last 15 lines of file : tail -15 FILENAME tail -f : Get latest lines of file continuously : tail -f FILENAME grep Get lines matching pattern : grep PATTERN FILE(S) Get lines not matching pattern : grep -v PATTERN FILE(S) Get file names not matching pattern : grep -L PATTERN FILE(S) Get line numbers matching pattern : grep -n PATTERN FILE(S) Case-insensitive search for pattern : grep -i PATTERN FILE(S) Recursive search : grep -R PATTERN DIRECTORY TODO - Translate to Spanish. - review and improve if needed. SEE ALSO openbsd(oh), slackware(oh) OpenBSD manpages: paste(1), tr(1), head(1), tail(1), grep(1) HISTORY 2026-06-02 : Fixed name: text_manipulation > text_processing. 2025-10-03 : Created AUTHORS ohazot(oh) | about(oh) | ohazot.com: https://ohazot.com 2026-06-02 TEXT_PROCESSING(oh)