Answers for "bash n lines to new file"

1

add lines to a file bash

how to add lines inside a file

sed -i -e "50r../../../../folder1/lines_to_add.txt" a.txt 

a.txt - the file you want to change.
50r is line number of a.txt 
some lines are inside lines_to_add.txt file
../../../../folder/lines_to_add.txt 
-i update a.txt, try without -i before runthe code,
be carefull with "newlines", 
"keep a newline at the end of lines_to_add.txt"
Posted by: Guest on July-20-2021
1

echo new line in a file bash

echo -e "Line 1nLine 2"
Posted by: Guest on March-24-2021

Code answers related to "bash n lines to new file"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language