diff without comments diff -BI '^#' file{1,2} diff two files by ignoring any comment lines starting with a #