{"repo":"chmln/sd","free":true,"listed":false,"github":"https://github.com/chmln/sd","clone":"git clone https://github.com/chmln/sd.git","description":"Intuitive find & replace CLI (sed alternative)","language":"Rust","stars":7305,"topics":["command-line","rust","terminal","text-processing","regex","cli"],"license":"MIT","category":"cli-tools","readme_excerpt":"sd - s earch & d isplace sd is an intuitive find & replace CLI. The Pitch Why use it over any existing tools? Painless regular expressions. &nbsp; sd uses regex syntax that you already know from JavaScript and Python. Forget about dealing with quirks of sed or awk - get productive immediately. String-literal mode. &nbsp; Non-regex find & replace. No more backslashes or remembering which characters are special and need to be escaped. Easy to read, easy to write. &nbsp; Find & replace expressions are split up, which makes them easy to read and write. No more messing with unclosed and escaped slashes. Smart, common-sense defaults. &nbsp; Defaults follow common sense and are tailored for typical daily use. Comparison to sed While sed does a whole lot more, sd focuses on doing just one thing and doing it well. Here are some cherry-picked examples where sd shines. Simpler syntax for replacing all occurrences: - sd: sd before after - sed: sed s/before/after/g Replace newlines with commas: - sd: sd -A '\\n' ',' - sed: sed ':a;N;$!ba;s/\\n/,/g' Note: this requires -A (across mode) since \\n is a cross-line pattern. Extracting stuff out of strings containing slashes: - sd: echo \"sample with /path/\" sd '. (/. /)' '$1' - sed: echo \"sample with /path/\" sed -E 's/. (\\\\/. \\\\/)/\\1/g' With sed, you can make it better with a different delimiter, but it is still messy: echo \"sample with /path/\" sed -E 's . (/. /) \\1 g' In place modification of files: - sd: sd before after file.txt - sed: sed -i -e","default_branch":null,"files":null,"tree":[],"storefront":"/r/chmln","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/chmln/sd/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}