-1

How can I use the sed command (in Linux) to find the 1000th line in a file with 10000 lines and replace just that one line with another?

Thanks in advance!

Eric Galluzzo
  • 3,191
  • 1
  • 20
  • 20
Bhushan Ahire
  • 79
  • 1
  • 6

1 Answers1

2

Like this:

sed '1000 s/foo/bar/' file.txt
Andrew Cheong
  • 29,362
  • 15
  • 90
  • 145