Forrest logo
back to the cksum tool

cksum:tldr:cb6ab

cksum: Display a 32-bit checksum, size in bytes and filename.
$ cksum ${filename}
try on your machine

The command "cksum ${filename}" is used to calculate the checksum value of a file.

Here's how it works:

  1. The variable "${filename}" refers to the name of the file for which you want to calculate the checksum. You need to replace "${filename}" with the actual name of the file you want to calculate the checksum for.

  2. The "cksum" command is a utility in Unix and Unix-like operating systems that calculates the cyclic redundancy check (CRC) checksum of a file. The CRC checksum is a value that is derived from the contents of the file and is commonly used to verify the integrity of files and detect errors.

  3. When you run the command "cksum ${filename}", the cksum utility reads the contents of the specified file and performs calculations to generate a unique checksum value.

  4. The output of the command will consist of three values: the checksum value, the total number of bytes in the file, and the filename itself.

The checksum value can be compared with the one generated earlier for the same file to verify if the file has remained unchanged. If the checksum values match, it indicates that the file's content has not been tampered with and is the same. However, if the checksum values differ, it indicates that the file has been modified.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the cksum tool