I have a situation where i want to replace a particular string in many files
Replace a string AAA with another string BBB but there are lot of strings starting with AAA or ending in AAA ,and i want to replace only one on line 34 and keep others intact.
Is it possible to specify by line number,on all files this string is exactly on 34th line.
sed 34,$s/aaa/bbb/ filename
you can find all options using the man pages under the addresses section: man sed
– Kevin P. Feb 15 '20 at 02:52