You have several options. The easiest option is sed:
find ./ -name somename.txt -exec sed -e '1i My new text here` {} \;
It will be faster if you add '2q' to say that it is done after the preliminary text, and if this happens in the file with the -i flag
find ./ -name somename.txt -exec sed -i .bak -e '2q;1i My new text here` {} \;
This leaves the source files with the extension .bak .
source share