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