How to replace a line in a text file by line number-Sed
In this post we will give you information about How to replace a line in a text file by line number-Sed. Hear we will give you detail about How to replace a line in a text file by line number-SedAnd how to use it also give you demo for it if it is necessary.
To replace a line in a text file by using line number we can use the following command in sed.
sed '2 chello you can see me in 2nd line' myfile.txt
This above command will replace the second line with a hello you can see me in 2nd line.
Hope this code and post will helped you for implement How to replace a line in a text file by line number-Sed. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs