Results 1 to 4 of 4
hi,
I try to compare two text files are same or not.
temp1.txt and temp2.txt are located in /usr/local/.
I want to compare the two are same or not using ...
- 10-26-2006 #1Just Joined!
- Join Date
- Oct 2006
- Posts
- 14
how to test two text file equal in size using Script
hi,
I try to compare two text files are same or not.
temp1.txt and temp2.txt are located in /usr/local/.
I want to compare the two are same or not using linux shell script.
For that,
I use
It gives error.Code:if [ temp1.txt = temp2.txt ] then echo files same else echo files not same
can any one give me idea.
- 10-26-2006 #2
If I were you, I'd generate an md5sum for each file and compare those.
Flies of a particular kind, i.e. time-flies, are fond of an arrow.
Registered Linux User #408794
- 10-26-2006 #3Linux Newbie
- Join Date
- Aug 2006
- Posts
- 226
You need to use the diff command. It will already be installed on your system. I'd type "man diff" from the terminal to see the usage that works best for you.
- 10-26-2006 #4
You could also use cmp; that's more common for binary files.
Flies of a particular kind, i.e. time-flies, are fond of an arrow.
Registered Linux User #408794


Reply With Quote