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