sd Command Examples

Intuitive find and replace. More information: https://github.com/chmln/sd.

{{echo 'lorem ipsum 23 '}} | sd '\s+$' ''

{{echo 'cargo +nightly watch'}} | sd '(\w+)\s+\+(\w+)\s+(\w+)' 'cmd: $1, channel: $2, subcmd: $3'

sd -p {{'window.fetch'}} {{'fetch'}} {{path/to/file.js}}

sd {{'from "react"'}} {{'from "preact"'}} "$(find . -type f)"