Intuitive find & replace CLI - a simpler, faster alternative to sed.
sd (search & displace) is an intuitive command-line tool designed to make find & replace operations painless and efficient. It addresses the complexity and quirks of traditional Unix tools like sed and awk by using familiar regex syntax from JavaScript and Python, making it immediately productive for developers who already know these patterns.
The tool shines with its smart defaults and clean syntax. Simple replacements that require complex sed commands become straightforward with sd - for example, replacing all occurrences is just 'sd before after' compared to sed's 's/before/after/g'. It also offers a string-literal mode for non-regex operations, eliminating the need to escape special characters when you just want literal text replacement.
Beyond ease of use, sd delivers impressive performance gains, benchmarking 2-12 times faster than sed on large files. It supports both in-place file modification and preview modes, handles capture groups (both indexed and named), and integrates seamlessly with other Unix tools. The tool is perfect for developers, system administrators, and anyone who regularly performs text processing tasks and wants a more intuitive, faster alternative to traditional Unix text manipulation tools.
# via Cargo
cargo install sd