Digital Marketing

How to prepend to a Linux file

How to insert line to the beginning of file on Linux

$ sed '1 s/^/This is the line to prepend\n/' file-to-be-prepended

Modify in place:

$ sed  -i '1 s/^/This is the line to prepend\n/' file-to-be-prepended

Comments

Popular posts from this blog

Fixed WSL sshd: no hostkeys available -- exiting

PowerMTA pmta command

How to fix: mv: failed to preserve ownership