terminal-linux
terminal-linux

This is 1m read blog. In this blog we will check how to replace source string with replacement string for file with SED command.

Syntax:

$ sed -e "s/<source-string>/<replacement-string>/ig" <input-file> >> <output-file>

Dry-run:

$ sed -e "s/<source-string>/<replacement-string>/ig" <input-file>

Example:

$ sed -e "s/kuberneteslab/dockerslab/ig" kuberneteslab-file.txt >> dockerslab-file.txt

You can see the result inside the file after successful command run. Thank you for reading our 1m blog.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments