How do i replace a word using dot to match any character in sed?
-
Man page for sed: https://www.lightnetics.com/post/3334
Using the sample file:
$ cat linefile This is line one This is line two This is line three
We want to replace the word two with 2, use this, match any character before letters wo and replace with 2. Be careful as any word ending in wo would be replaced, this is just a demo of the dot usage.
$ sed 's/.wo/2/g' linefile
Result:
This is line one
This is line 2
This is line three
© Lightnetics 2024