I was trying to find the way for knowing if two files are the same, and found this post…
Parsing result of Diff in Shell Script
I used the code in the first answer, but i think it’s not working or at least i cant get it to work properly…
I even tried to make a copy of a file and compare both (copy and original), and i still get the answer as if they were different, when they shouldn’t be.
Could someone give me a hand, or explain what’s happening?
Thanks so much;
peixe
Are you trying to compare if two files have the same content, or are you trying to find if they are the same file (two hard links)?
If you are just comparing two files, then try:
or
in order to see the supposed differences.
You can also try
md5sum:If both files return same checksum, then they are identical.