- Suppose you had a text file with the contents and you wanted to insert a string to the beginning:
1st line
2nd line
3rd line
- Run the command:
sed -i '1i Top of the file!' <filename>
- Now the file will look like this:
Top of the file!
1st line
2nd line
3rd line
Awk Sed Code
© 2020
Comments are closed.