Favicon of sd

sd

Intuitive command-line find and replace tool with regex support, string-literal mode, and 10x faster performance than sed for complex replacements.

sd is a modern command-line utility that makes search and replace operations intuitive and efficient. It replaces the complexity of traditional tools like sed with a cleaner, more readable approach to text manipulation.

Key advantages over sed:

  • Readable syntax - Find and replace expressions are clearly separated, eliminating confusing escaped slashes and special character escaping
  • String-literal mode - Use the -F flag for non-regex replacements without worrying about escaping special characters
  • Familiar regex patterns - Supports JavaScript and Python-style regex syntax you already know
  • Smart defaults - Sensible configuration for everyday use cases without requiring multiple flags
  • Exceptional performance - Benchmarks show sd is 2-11x faster than sed for both simple and complex replacements

Core features:

  • Indexed and named capture groups for flexible replacements
  • Line-by-line processing (3MB memory) or across-mode for multi-line patterns
  • In-place file modification with preview option
  • Seamless integration with other Unix tools
  • Handles edge cases like patterns containing slashes without delimiter confusion

Common use cases:

Trim trailing whitespace, extract and reformat data, replace across entire projects, modify configuration files, and process large datasets efficiently. Whether you need simple literal replacements or complex regex transformations, sd delivers with minimal syntax overhead and maximum clarity.

Features

Scriptable

Media

Pros

4
  • intuitive find and replace with regex support
  • string-literal mode for non-regex replacements
  • faster than sed for complex replacements
  • simple syntax for common operations

Cons

1
  • less feature-rich than sed for advanced use cases

Related tools

Share:

Auto-fetched .

Recent releases

Similar to sd

Favicon

 

  
 
Favicon

 

  
 
Favicon