Bash insert text before the first line of the file

Posted on November 11, 2017 at 11:56 pm

Insert text before the first line of the file using sed:

sed -i '1 i\TEXT_TO_INSERT' /path/to/file

Other Posts

Updated Posts