Compare the two files in linux (how to use the md5sum command in linux)

Source: Internet
Author: User
In linux or Unix, md5sum is a tool program used to calculate and verify the file message digest. let's take a look at several examples.

1. Introduction

The MD5 algorithm is often used to verify the integrity of network file transmission and prevent file tampering.The full name of MD5 is the Message Digest Algorithm (Message-Digest Algorithm 5). This Algorithm computes information of any length by bit, generate a "fingerprint" (or "message digest") with a binary length of 128 bits (32 bits in hexadecimal format "), different files may generate the same message digest.
In linux or Unix, md5sum is a tool program used to calculate and verify the file message digest. Generally, after Linux is installed, the md5sum tool runs directly on the command line terminal.

2. command format

Md5sum [OPTION]... [FILE]...

3. command options

-B or -- binary: treats the input file as a binary file.
-T or -- text: view the input file as a text file (default ).
-C or -- check: used to read md5 information from the file to check file consistency. (For more information, see info)
-- Status: This option is used with check. the check result is displayed based on the returned value instead of output during check.
-W or -- warn: check whether the input md5 information is invalid during check. If yes, the corresponding information is output.

4. example

(1) generate the md5 value of a file, as shown in

 

(2) Check whether the two files are the same. you can compare the md5 values of the two files.

(3) determine whether a file is modified and use md5 to determine

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.