# echo "" > temp # cat yourfile >> temp # mv temp yourfile the awk way: awk 'BEGIN{print "new text"}1' file the sed way sed -e '1i new line' file