>>929
$ perl -i -npe 'print "page\n" if $.==1;' test.txt
はどうでしょう。