Sed Command: Replace a string with another string on the command line

Sed Command: Replace a string with another string on the command line

If you want to quickly replace a string with another string in a text file, try sed. Above is an example.

By using sed, I can change the string ‘sunny’ with ‘rainy’, ‘outside’ with ‘inside’. Pretty convenient isn’t it?

Use ‘s/sunny/rainy/g’ if you want to replace all occurrences of a string.

Search

Related Posts

Related Posts

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran