Terminal Lesson 17
Hey guys, it's Mad Kids.
In this short video, I'm going to be showing you how to check if files are the same and output a hash text. Horrified!
So first of all, what you want to do is open up your terminal application and do whatever you have to do to get to the command line.
Okay, so now to get the sum of a file, which is the overall number that represents the file, just type sum
, space, and then drag in a file. Then right here on the right, you get a number to the left that's normally five digits and a number on the right that can be one or two, however many digits.
Um, so that's the sum of a file. If I type sum
, space, and drag in a different file, the sum is going to be much different. So that's some.
Sum
is used to check and see if you downloaded a program, if it's the program that they compiled, because you check the sum of that program. So sum
is just used to check and see if a file is what you think it is or if it isn't what you think it isn't.
So that's just to compare two files and see if they're exact duplicates. There's another way to do this; it's more advanced. You type md5
, space, and drag in a file. For instance, I can drag in this file, hit enter, and it gives me the hash. It says md5 so-and-so so-and-so equals
and then a long, long, long hash.
A hash is basically the number put into an unmerciful algorithm that then gives you an output. So that's what passwords are normally. Passwords have, so we hash your password on the backend.
For instance, if you look and try to figure out someone's password, all you'll get is this random number. That's on you; you can't find the password. So that's the md5
in a file.
Say you want to just md5
a large phrase that you have copied in your clipboard. All you want to do is type md5
, hit enter, then you type it. For instance, "password," then you know press enter and then ctrl D
.
Now, that'll give you the hash, with, I think, it has the enter. Another way they do it, which is a little more complicated, is that you type echo
space -n
space quote and the string close quote space vertical-bar or I'm pipe space md5
.
Now, yep, sorry, not more. Why would I say more? So, as you can see, this is md5
of the word "password" without hitting enter, and this is md5
of the password with the enter.
So it makes a huge difference. One letter changes basically the entire hash. I guess the 60 right here, I think it is, is the only difference.
So md5
seems a little more accurate than sum
. So basically that is how to compare two files and compare two pieces of text with md5
and sum
.
So thanks for watching, my kids! Anon, if you like this video, please watch all our other videos in the back.