header=$(head -n 1 file) (printf "%s\n" "$header"; tail -n +2 file|grep -vFxe "$header" ) > newfile 1. grab the header line into a variable 2. print the header 3. print everything except the first line, and omit lines that look like the header