add sd
[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 <!--
9 -->
10
11 ### Updating `sd`
12
13 `webi sd@stable`
14
15 Use the `@beta` tag for pre-releases.
16
17
18 ## Cheat Sheet
19 > sd is a productive and faster replacement of sed and awk command used for editing files in command line interface,it uses regex syntax
20 > similar to those used in JavaScript and Python
21
22 ## Usage of sd:
23
24 ### Replacing Text in a File
25
26 ```bash
27  sd 'original word' 'final word' ./file_to_be_changed
28 ```
29
30 ### Taking out word inside slashes from a given string
31
32 ```bash
33  echo "string output shown /word inside slashes/" | sd '.*(/.*/)' '$1'
34   /word inside slashes/
35 ```
36
37 ### Using the string mode (-s)
38
39 ```bash
40  cat exm.txt
41   here is an @example
42
43  cat exm.txt| sd -s '@' ''
44   here is an example
45 ```
46
47