Alvin Alvin - 1 month ago 11
Linux Question

How to replace a string (characters and numbers)

I would like to replace rs101 to rs102, however it shows unterminated "s" command with this.

sed -i 's/rs101/rs102' file.name.


Is there any other solution ?

Answer

You should insert / after rs102 .

sed -i 's/rs101/rs102/' file.name.

Syntax for Search and Replace:

sed 's/search/replace/' file.name