Panel For Example Panel For Example Panel For Example

MD5 File Verification in Linux

Author : Adrian September 17, 2025

MD5 File Verification in Linu

Overview

The md5sum command generates an MD5 digest for files and can verify whether file contents have changed. It can also be used to determine if two files are identical. Because md5sum computes the checksum from file contents, it only verifies content and cannot detect changes to file metadata such as permissions or attributes.

Example: Creating Copies

[root@xuexi ~]# cp -a /etc/fstab /tmp/fstab [root@xuexi ~]# cp -a /etc/fstab /tmp/fstab1

Generate MD5 Checksums

[root@xuexi ~]# md5sum /tmp/fstab /tmp/fstab1 a612cd5d162e4620b442b0ff3474bf98 /tmp/fstab a612cd5d162e4620b442b0ff3474bf98 /tmp/fstab1

The identical MD5 values indicate the two files have the same content.

Saving Checksums and Verifying Later

Because each checksum line includes the path to the corresponding file, you can save the output to a file and later use that file to check whether the contents have been modified.

[root@xuexi ~]# md5sum /tmp/fstab /tmp/fstab1 > /tmp/fs.md5sum [root@xuexi ~]# md5sum -c /tmp/fs.md5sum /tmp/fstab: OK /tmp/fstab1: OK

Modify /tmp/fstab1 and check again:

[root@xuexi tmp]# echo aaa >>/tmp/fstab1 [root@xuexi tmp]# md5sum -c /tmp/fs.md5sum /tmp/fstab: OK /tmp/fstab1: FAILED md5sum: WARNING: 1 of 2 computed checksums did NOT match

Options When Using -c

  • --quiet: Do not display records that verify as OK
  • --status: Produce no output; use the command exit status to determine the result. If any record failed, the exit status is 1, otherwise 0.

[root@xuexi tmp]# md5sum --status -c /tmp/fs.md5sum [root@xuexi tmp]# echo $? 1

Batch Comparison

By comparing md5sum values you can determine whether multiple files have identical contents. For larger sets of files, it is convenient to automate the comparisons with a script.

Recommended Reading
Deploying Deep Learning Gait Recognition on Allwinner V853

Deploying Deep Learning Gait Recognition on Allwinner V853

March 23, 2026

Gait recognition on an embedded Allwinner V853 board using NPU acceleration, detailing PyTorch-to-NB model conversion, CPU preprocessing/postprocessing and CASIA-B evaluation.

Article
Differences: DSP vs Microcontroller vs Embedded Microprocessor

Differences: DSP vs Microcontroller vs Embedded Microprocessor

March 20, 2026

Compare DSP, microcontroller, and embedded microprocessor designs: DSP signal processing optimizations, microcontroller peripheral integration, and power/performance tradeoffs.

Article
Choosing Peripherals for Embedded Systems

Choosing Peripherals for Embedded Systems

March 20, 2026

Guide to selecting peripherals in embedded systems: compare memory, clock sources, timers, communication interfaces, I/O and ADCs with factors like speed, power, and stability.

Article
Two Embedded Microprocessor Architectures and Their Pros and Cons

Two Embedded Microprocessor Architectures and Their Pros and Cons

March 20, 2026

Overview of embedded microprocessor architectures (CISC vs RISC), trade-offs, advantages and limitations for embedded system design, power, performance, and integration.

Article
Three Main Components of an Embedded Microprocessor

Three Main Components of an Embedded Microprocessor

March 20, 2026

Technical overview of the embedded microprocessor architecture, summarizing its three cooperating subsystems and how the compute unit enables arithmetic and logical execution.

Article
Tesla Cuts Prices $2,000 on Three Main Models

Tesla Cuts Prices $2,000 on Three Main Models

March 20, 2026

Analysis of Tesla's recent price cuts, FSD subscription reduction and 14,000 layoffs after Q1 delivery declines, and competitive pressure from Chinese EV makers like BYD.

Article