text-processing

A guide to command-line tools for changing, filtering, sorting, counting, and analyzing text. It covers tools such as sed, awk, sort, cut, tr, and wc, with instructions for different operating systems.

In plain words
What is it for?
Finding and replacing text, extracting fields, sorting and removing duplicates, counting lines or words, changing characters, and selecting parts of files.
Why use it?
It helps avoid syntax mistakes caused by differences between macOS, Linux, and Windows, especially when editing files from the command line.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/bug-ops/zeph/text-processing
Any agent
npx skills add bug-ops/zeph --skill text-processing
Clone the repo
git clone --depth 1 https://github.com/bug-ops/zeph

Made for: Claude Code, Codex.

Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,415 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00079 $0.02415
Opus 5 $0.00039 $0.01208
Sonnet 5 $0.00016 $0.00483
Haiku 4.5 $0.00008 $0.00242

Measured 2d ago against content hash a8a644274090, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

text-processing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.zeph/skills/text-processing/SKILL.md · 255 lines

How it starts

The opening of the file, as written. The whole thing — 255 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Text Processing

Before running commands, detect the OS and load the matching reference for platform-specific syntax and gotchas:

  • Linuxreferences/linux.md (GNU sed/awk/sort with extended flags)
  • macOSreferences/macos.md (BSD sed/awk/sort, Homebrew GNU alternatives)
  • Windowsreferences/windows.md (PowerShell: Select-String, Import-Csv, ForEach-Object)

OS detection:

uname -s 2>/dev/null || echo Windows

Key platform difference: sed -i syntax varies — check the OS reference before in-place edits.

Quick Reference

Task Portable command
Find and replace (stdout) sed 's/old/new/g' file
Extract column awk '{print $2}' file
Cut field (delimited) cut -d',' -f2 file
Sort lines sort file
Unique lines sort file | uniq
Count lines/words/chars wc -lwc file
Translate characters tr 'a-z' 'A-Z' < file
First N lines head -n 10 file
Last N lines tail -n 10 file

sed — Stream Editor

Substitution (portable)

# Replace first occurrence per line
sed 's/foo/bar/' file.txt

# Replace all occurrences per line
sed 's/foo/bar/g' file.txt

# Use different delimiter (when pattern contains /)
sed 's|/usr/local|/opt|g' file.txt

# Replace on specific lines
sed '5s/foo/bar/g' file.txt          # line 5 only
sed '10,20s/foo/bar/g' file.txt      # lines 10-20
sed '/pattern/s/foo/bar/g' file.txt  # lines matching pattern

# Extended regex (-E works on both GNU and BSD)
sed -E 's/([a-z]+)_([a-z]+)/\2_\1/g' file.txt

# Capture groups (BRE)
sed 's/\(.*\)=\(.*\)/\2=\1/' file.txt

Deletion (portable)

sed '/pattern/d' file.txt            # delete matching lines
sed '5d' file.txt                    # delete line 5
sed '10,20d' file.txt                # delete range
sed '/^$/d' file.txt                 # delete empty lines
sed '/pattern/!d' file.txt           # delete NON-matching

Print and Extract (portable)

Read the full file on GitHub · 255 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 255 lines · 79 tokens per session scan A a8a644274090

Subscribe to this mod's changes

text-processing is a skill published in the GitHub repository bug-ops/zeph (57 stars, last pushed 7d ago), licensed MIT. It adds 79 tokens to every session and 2,415 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.