Sed

Prepend string to file

sed -i '1s/^/some text that should be first\n/' /dir/file