grep -v -F -x -f <( head -n 1 file.csv | tee file-new.csv ) file.csv >>file-new.csv This is using a shell that has process substitutions (<(...)), like bash or zsh, to get the header line from the file using head, write that to a new file with tee, and then filter out all header lines out from the original file using grep. The filtered lines are appended to the new file, after the header which was previously written there by tee.
This way of doing it does not depend on what the header actually is. It's just deletingextracting all lines from the original file that happen to be identical todifferent from the first line of the file.
Without the process substitution:
head -n 1 file.csv | tee file-new.csv | grep -v -F -x -f /dev/stdin file.csv >>file-new.csv