Check if the CRC of the file is correct
The cksum command is to check whether the CRC of the file is correct to ensure that the file is not damaged during transfer from one system to another. This method requires that the checksum be calculated in the source system and again in the destination system, the two numbers are compared, and if the checksums are equal, the file is considered to have been transferred correctly.
Note: CRC refers to a debugging checking method, the cyclic redundancy check method.
After the specified file is verified by the cksum command, the verification result will be returned for the user to check whether the file is correct. If no file name is specified or the file name is given as "-", the cksum command will read data from the standard input device.
cksum(options)(parameters)
--help: online help;
--version: Display version information.
File: Specify the version information to be calculated for verification.
Use the cksum command to calculate the integrity of the file "testfile1" and enter the following command:
cksum testfile1 #Perform CRC check on the specified file
After the above command is executed, the verification code and other related information will be output. The specific output information is as follows:
1263453430 78 testfile1 #Output information
In the above output information, "1263453430" represents the check code, and "78" represents the number of bytes.
Note: If any characters in the file are modified, the value of the calculated CRC check code will be changed.