Windows equivalent of linux cksum command

121,500

Solution 1

In Windows (command prompt) you can use CertUtil, here is the syntax:

CertUtil [Options] -hashfile InFile [HashAlgorithm]

for syntax explanation type in cmd:

CertUtil -hashfile -?

example:

CertUtil -hashfile C:\myFile.txt MD5

default is SHA1 it supports: MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512. Unfortunately no CRC32 as Unix shell does.

Here is a link if you want to find out more https://technet.microsoft.com/en-us/library/cc732443.aspx#BKMK_menu

Solution 2

It looks as if there is an unsupported tool for checksums from MS. It's light on features but appears to do what you're asking for. It was published in August of 2012. It's called "Microsoft File Checksum Integrity Verifier".

http://www.microsoft.com/en-us/download/details.aspx?id=11533

Solution 3

To avoid annoying non-checksum lines : CertUtil -v -hashfile "your_file" SHA1 | FIND /V "CertUtil" This will display only line(s) NOT contaning CertUtil

Solution 4

Open Windows PowerShell, and use the below command:

Get-FileHash C:\Users\Deepak\Downloads\ubuntu-20.10-desktop-amd64.iso

Solution 5

In the year 2019, Microsoft offers the following solution for Windows 10. This solution works for SHA256 checksum.

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-filehash?view=powershell-6

Press the Windows key. Type PowerShell. Select Windows Powershell. Press Enter key. Paste the command

Get-FileHash C:\Users\Donald\Downloads\File-to-be-checked-by-sha256.exe | Format-List

Replace File-to-be-checked-by-sha256.exe by the name of your file to be checked.

Replace the path to your path where the file is. Press Enter key. Powershell shows then the following

Algorithm : SHA256 Hash : 123456789ABCDEFGH1234567890... Path : C:\Users\Donald\Downloads\File-to-be-checked-by-sha256.exe

Share:
121,500
AabinGunz
Author by

AabinGunz

Quiet and fun loving, here to learn and share. :) SOreadytohelp Got to share some amazing things. Thanks SO.

Updated on July 05, 2022

Comments

  • AabinGunz
    AabinGunz almost 2 years

    I am looking for a way to compute crc checksum cross platform.

    cksum works on Linux, AIX, HP-UX Itanium, Solaris, is there a equivalent command of linux cksum in windows too?

    %cksum run.sh
    1491301976 652 run.sh
    

    Note: no third party tool

  • user667489
    user667489 over 11 years
    N.B. does not support CRC checks, just MD5 and SHA-1.
  • Larry K
    Larry K almost 10 years
    IBM has a list of MD5 checksum apps for different platforms
  • tux3
    tux3 about 9 years
    Please don't just post a link to the answer, try to explain it yourself.
  • sst
    sst about 9 years
    @tux3 There is a short explanation that describes the purpose of the link, and the answer is relevant to the question . But since I'm new here and that was my first post in stackoverflow, I may have missed something. So I would be grateful if you describe more clearly to me that what else should be explained, so that I can improve my answers in the future and be more helpful to the community
  • AabinGunz
    AabinGunz almost 9 years
    It will be a customer system and they might not have a third party tool installed, so I need to go with something which comes within windows. At present I am using java to get this done. Thanks for your answer.
  • Cassian
    Cassian almost 9 years
    CertUtil comes within windows
  • Cassian
    Cassian almost 9 years
    side note: cksum in unix, uses CRC32 compliant with POSIX 1003.2
  • James M. Greene
    James M. Greene over 7 years
    This is the best built-in answer though the output is incredibly annoying as it has other non-checksum lines printed to stdout before and after the checksum as well (on Windows 10, at least).
  • manuelvigarcia
    manuelvigarcia about 7 years
    There is a kind of manual with examples of command line to use the utility at en.wikibooks.org/wiki/…
  • Marc.2377
    Marc.2377 over 4 years
    It also doesn't offer actual CRC32.
  • Marc.2377
    Marc.2377 over 4 years
    -v is counter-productive here.
  • Glenn Maynard
    Glenn Maynard about 3 years
    "Try to explain it yourself" in a post linking to an application. People don't always use common sense...