#below inserts a line at 1st row with the content "Added new line using sed " in all the files in the path
for i in *; do sed -i '1s/^/Added new line using sed \n/' $i; done
#below inserts a line at 3rd row with the content "Added new line using sed " in all the files in the path
for i in *; do sed -i '3s/^/Added new line using sed \n/' $i; done
No comments:
Post a Comment