-1

I have two files namely file1 and file2. I need to replace 16th line of file2 with 10th line of file1

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
sarath
  • 1

1 Answers1

1

Use sed (stream editor):

sed '16 s/.*/'"$(sed -n '10p' file1)"'/' file2
RomanPerekhrest
  • 29,703
  • 3
  • 43
  • 67