How do I check the SHA1 hash of a file?

sha1sum

Print or check SHA1 (160-bit) checksums. With no FILE, or when FILE is -, read standard input.

sha1sum {file}

If you want to send the file together with its sha1sum output redirect the output to a file:

sha1sum {file} > {file}.sha1

Send both files and the other party can do a...

sha1sum -c {file}.sha1

It should show OK if the sha1 is correct.


Without creating local file:

$ sha1sum filename

8dd10000eb1b768800000e1d2fe1c3100005d2dc *filename

For checking, go to the directory that contains filename and run this command:

echo "8dd10000eb1b768800000e1d2fe1c3100005d2dc *filename" | sha1sum -c -

Its very simple.

Navigate to the terminal and key in:

sha1sum  filename

to confirm a sha1 hash use:

sha1sum -c filename

Tags:

Checksums