Answers for "add line at beginning of file unix"

0

add line at beginning of file unix

sed -i '1s/^/your text\n/' file #Note the addition of the "\n" for concluding the new line after the insertion
Posted by: Guest on September-20-2021
-1

add line to beginning of file shell script

$ sed -i '1s/^/added text /' file
Posted by: Guest on February-16-2021

Code answers related to "add line at beginning of file unix"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language