how to copy first 10 lines from one file to another in unix code example Example: copy first 10 lines of a file to another file in unix sed -n '1,10p' filename > newfile