Replace the string on a specific line number only.
sed '3 s/unix/linux/' filename
Input file
aaaaa bbbbb ccccc ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee
Run:
sed '3 s/cc/linux/' file.txt
returns:
aaaaa bbbbb linuxccc ddddd eeeee aaaaa bbbbb ccccc ddddd eeeee