How to copy the first few lines of a giant file, and add a line of text at the end of it using some Linux commands?

Viewed 152276

How do I copy the first few lines of a giant file and add a line of text at the end of it, using some Linux commands?

4 Answers
sed -n '1,10p' filename > newfile
echo 'This goes at the end of the file' >> newfile
Related