We're going to compare two files, how that is done.
There are two very basic commands that that are used in Linux.
The first one is the diff, which is going to compare two files line by line and the second one is CMP
compared and it does byte by byte.
You can look at these two commands by logging into our system.
We'll use a putty session.
And if you remember the putty session, we would need the IP address of our machine.
If you don't remember the IP address, you could go back into your console, you log in
and you do.
You do config.
Pipe it more because we don't want it to see the information going too fast.
So I'm piping it to more and you'll see the IP addresses right here.
You can put that IP address in your putty and you will be able to connect to it.
So let's minimize this and let's see who we are.
Sorry, who am I?
Which directory I'm in?
I'm in home.
Do what's inside my directory.
I want to go into the directory, Superman, and see what's inside.
In Superman I have.
I want to remove this file.
I create it earlier.
So this way it will be easier for you to, in the seminar, recreate it.
So I'll remove it.
So, okay, so I am in this directory home.
I have Superman and I want you to create a file called Superman characters.
So let's do touch.
Sorry, not touch echo and the first character, Clark Kent, and put it into Superman characters.
It's there.
Yes, it's there.
And then Echo.
Lois Lane.
Double Superman characters Echo and Charles Zod.
Superman character.
There's the cat and you'll see it has three lines.
Clark, Lois Lane and General Zod.
I want you to create another file.
Call it Super Superman characters, too.
So up arrow key.
Go back to your first file, and this time I want you to do same thing, same and do Character two Hit
enter.
Then you will do the same thing.
General Zod.
But to.
I know it was Lois Lane.
Yes.
So, Lois Lane.
Character two And the last one is.
ZOI but this time I don't want you to do so.
I want you to join Peter and enter.
Let's check the Superman too.
You see, the Superman, too has Joel, Peter and the Superman Dash characters as General Zod.
Now, let's do comparison.
If you want to compare two files, we'll do the first one.
We'll do diff and Superman characters with Superman characters too.
It's going to tell you the first file right here has the General Zod on it and the second one has Peter.
Now, what if I want to compare it?
Superman.
Superman two again, you could do just tab and autocomplete and it will tell you the last three lines,
the 330 bytes, that that's the big difference.
So that's what the two commands that we use in Linux to compare two files, there is not an easy way
to compare two files in Windows.
So that's why, again, this gives us a huge advantage to do file tax manipulation in Linux.
Again, I want you to do man command on both commands and camp and just learn different options that
are available.