Linux Commander File integrity (MD5,SHA1)

Source: Internet
Author: User
Tags sha1



People who often download software under Linux must have a good habit of verifying the hash of the file to determine the integrity of the file or even security. When I configure the environment also happens to use, the author is a lubuntu machine. I'll make a rough record here. (If you do not know the hash, please check the relevant information yourself)



MD5 Check:





[email protected]:~/lnmp$ md5sum lnmp1.3-full.tar.gz
a5aa55cd177cd9b9176ad697c12e45c0  lnmp1.3-full.tar.gz





Or we can save it to a file:


[Email protected]:~/lnmp$ md5sum lnmp1.3-full.tar.gz > Md5-hash.txt





And then:


[email protected]:~/lnmp$ cat md5-hash.txt 
a5aa55cd177cd9b9176ad697c12e45c0  lnmp1.3-full.tar.gz

You can also confirm the file according to the hash you have obtained:

SHA1:



This is similar to the MD5 check method:





[email protected]: ~ / lnmp $ md5sum -c md5-hash.txt
lnmp1.3-full.tar.gz: OK
[email protected]: ~ / lnmp $





or save it to a file and check it out:


[email protected]:~/lnmp$ sha1sum lnmp1.3-full.tar.gz 
ee7ec6e8be0b3b5a481df903427261236f9bb057  lnmp1.3-full.tar.gz





Check for known hash conditions (usually quite a lot):



[email protected]: ~ / lnmp $ sha1sum -c sha1-hash.txt
lnmp1.3-full.tar.gz: OK
[email protected]: ~ / lnmp $





Note: In the case of a known hash value of the file to verify the time to pay attention to, make sure that the system can find the file to be verified. Otherwise, it will be impossible to verify. Specific instructions for use can be viewed through the MD5 (SHA1) sum--help:





[email protected]: ~ / lnmp $ sha1sum --help
Usage: sha1sum [OPTION] ... [FILE] ...
Print or check SHA1 (160-bit) checksums.

If no file is specified, or the file is "-", it is read from standard input.

  -b, --binary read in binary mode
  -c, --check read SHA1 check value from file and check
      --tag create a BSD-style checksum
  -t, --text read in plain text mode (default)

The following five options are useful only when verifying checksums:
      --ignore-missing do n‘t fail or report status for missing files
      --quiet do n‘t print OK for each successfully verified file
      --status do n‘t output anything, status code shows success
      --strict exit non-zero for improperly formatted checksum lines
  -w, --warn warn about improperly formatted checksum lines

      --help display this help message and exit
      --version display version information and exit

The sums are computed as described in FIPS-180-1. When checking, the input
should be a former output of this program. The default mode is to print a
line with checksum, a space, a character indicating input mode (‘*‘ for binary,
‘‘ For text or where binary is insignificant), and name for each FILE.

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Please report sha1sum translation errors to <http://translationproject.org/team/en_US.html>
Full documentation at: <http://www.gnu.org/software/coreutils/sha1sum>
or available locally via: info ‘(coreutils) sha1sum invocation’
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.