sed

Perform regex-based text substitutions and transformations on streams.

Updated Jul 2, 2024
One-click install
npx skills add https://github.com/jyasuu/cheat-sheet --skill sed
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sed
Source: https://github.com/jyasuu/cheat-sheet/tree/main/skills/sed
Command: npx skills add https://github.com/jyasuu/cheat-sheet --skill sed

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Sed empowers you to perform text substitutions, line operations, and transformations directly in streams, reducing manual editing work.

Core Features & Use Cases

  • In-place editing: Edit files directly without creating backups (with optional backups as needed).
  • Regex-powered substitutions: Apply complex pattern replacements across files or streams.
  • Line and pattern operations: Extract, print, delete, and transform lines based on patterns or ranges.
  • Use Case: Normalize whitespace and reformat text across a codebase during a build or cleanup.

Quick Start

Perform a simple substitution on a file by replacing all occurrences of "old" with "new" using sed.

Frequently Asked Questions about sed

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform in-place text substitution across multiple config files?

In-place text substitution across config files is achieved by applying regex-powered replacements directly to the file stream. You can edit files without creating backups or generate optional backups as needed during the transformation.

What is the best way to automate batch text processing on log files?

Batch text processing on log files is automated by performing stream-based text transformations. This approach relies on regex substitutions to extract, delete, or transform specific lines and patterns across large volumes of log data.

Can I use regex to normalize whitespace across an entire codebase?

Yes, you can use regex to normalize whitespace across a codebase during a build or cleanup. Regex-powered substitutions apply complex pattern replacements across files or streams to reformat text consistently.

How does stream editing handle multi-line patterns?

Stream editing handles multi-line patterns by applying robust regex-based substitutions across continuous text streams. This allows you to extract, print, delete, and transform lines based on complex pattern ranges.

Do I need to create backup files when editing text streams directly?

You do not need to create backup files when editing text streams directly. In-place editing can modify files without backups, although you can optionally generate them as needed for safety before applying transformations.