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