Linux cksum Command

Linux 命令大全Linux Command Reference

The Linux cksum command is used to check whether the CRC of a file is correct, ensuring that the file is not corrupted during transmission from one system to another.

CRC is an error-checking method. The standard for this checksum method is specified by CCITT, and it can detect at least 99.998% of known errors.

After the specified file is given to the command "cksum" for verification, the command will return the checksum result for the user to check whether the file is correct. If no file name is specified, or the given file name is "-", the command "cksum" will read data from the standard input device.

Syntax

cksum [--help][--version][文件...]

Parameters:

  • --help: Online help.
  • --version: Display version information.
  • file...: The path of the file to be checked.

Examples

Use the command "cksum" to calculate the integrity of the file "testfile1", enter the following command:

$ cksum testfile1       

After the above command is executed, it will output related information such as the checksum, as shown below:

1263453430 78 testfile1         //输出信息 

In the output information above, "1263453430" represents the checksum, and "78" represents the number of bytes.

Note:If any character in the file is modified, the calculated CRC checksum value will change.

Linux 命令大全Linux Command Reference

Other Extensions