sed -n '1,10p' filename > newfile
head -n10 file.txt >> newfile.txt echo "your line >> newfile.txt tail -n +10 file.txt >> newfile.txt