refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / sd / README.md
1 ---
2 title: sd
3 homepage: https://github.com/chmln/sd
4 tagline: |
5   sd is an intuitive find & replace CLI.
6 ---
7
8 To update or switch versions, run `webi sd@stable` (or `@v0.7`, `@beta`, etc).
9
10 ## Cheat Sheet
11
12 > sd is a productive and faster replacement of sed and awk command used for
13 > editing files in command line interface,it uses regex syntax similar to those
14 > used in JavaScript and Python
15
16 ## Usage of sd:
17
18 ### Replacing Text in a File
19
20 ```bash
21 sd 'original word' 'final word' ./file_to_be_changed
22 ```
23
24 ### Taking out word inside slashes from a given string
25
26 ```bash
27 echo "string output shown /word inside slashes/" | sd '.*(/.*/)' '$1'
28   /word inside slashes/
29 ```
30
31 ### Using the string mode (-s)
32
33 ```bash
34  cat exm.txt
35   here is an @example
36
37  cat exm.txt| sd -s '@' ''
38   here is an example
39 ```