← ClaudeAtlas

sedlisted

Expert GNU sed one-liner generation and transformation. Use this skill whenever the user asks to transform text, edit files in-place, refactor code via CLI, process logs, do bulk find/replace, extract lines, delete patterns, or perform any stream editing task. Trigger on keywords like "sed", "replace in files", "find and replace", "edit in place", "strip lines", "extract pattern", "log filtering", "batch rename content", "remove lines matching", "transform output", or any request that maps to a sed one-liner or pipeline. When in doubt, use this skill — sed is often the right tool.
bastos/skills · ★ 7 · Data & Documents · score 68
Install: claude install-skill bastos/skills
# GNU sed Skill All output assumes **GNU sed** (`sed --version` shows GNU). POSIX compatibility is not a goal; use `-E` (extended regex) by default unless basic regex is clearly sufficient. --- ## Core Principles 1. **Prefer one-liners.** Multi-line sed scripts are a last resort. 2. **Use `-E`** for extended regex (avoids backslash noise). 3. **Use `-i` for in-place edits**; always show the command with a backup suffix suggestion (`-i.bak`) if the operation is destructive. 4. **Dry-run first.** When editing files, show the `sed` without `-i` before the in-place version so the user can verify. 5. **Chain with pipes** when sed alone isn't the cleanest tool. 6. **Never use sed to parse structured formats** (JSON, YAML, XML). Redirect to `jq`, `yq`, or `xmllint` and say why. --- ## Flags to Always Know | Flag | Meaning | |--------------|--------------------------------------------------| | `-E` | Extended regex (ERE): `+`, `?`, `|`, `()` work without backslash | | `-i[SUFFIX]` | Edit in place (GNU: `-i` or `-i''` for no backup, `-i.bak` for backup) | | `-n` | Suppress automatic print; use with `p` to print selectively | | `-e` | Multiple expressions in one invocation | | `-f FILE` | Read commands from a script file | | `--sandbox` | Disallow `e`, `r`, `w` commands (safe mode) | --- ## Command Quick Reference ### Substitution (`s`) ```bash # Basic replace