Replace text in file using sed in Linux

Donald Le
Nov 17, 2020

When it comes to find text we often think of grep or awk. But to replace text in file is really simple with sed.

For example you want to replace “ensemble” to “ensembl”, just

sed -i 's/ensemble/ensembl/g' input.txt

Hope it helps

PEACE~~~

--

--

Donald Le

A passionate automation engineer who strongly believes in “A man can do anything he wants if he puts in the work”.