On Feb 4, 2008 5:09 PM, George M.
[email protected] wrote:
2 small unix related questions.
does anyone know about:
- a quick and easy way to remove duplicate lines from a text files?
uniq < filename (assuming that the lines are consequtive; otherwise,
you need to do a sort first, or keep the lines in a hash in either
Ruby or Perl)
- a quick and easy way to decide if two image (binary) files are the same
Do you mean if they are identical? cmp should do it. Another
approach is to get a checksum of the files (e.g. using "openssl rmd160
") and see if the checksum is the same.