this post will show you how to add text at beginning of file linux command using the linux shell command using sed you can insert and put one more line at the top of the file using whatever text you want to use

for example, i want to put on the first line a comment in my .htaccess file in my webs directory located at /var/webune/support/.htaccess


'sed -i.bak '1i #These are Webune Comments ' /var/webune/support/.htaccess


this code will create a backup copy called .htaccess.bak and also add #These are Webune Comments to the first line

hope that help and this is what you were looking for

this was tested in a Fedora,Redhat, CentOS machine