# Files must be sorted (actually lexicographically sorted, not just in the same # order as each other for matching lines). comm -23 file1 file2 # If you have a shell like bash that supports process substitution, you can do: comm -23 <(sort file1 | uniq) <(sort file2 | uniq) If you want human-readable output, consider diff or diff -u.