Linux cksum Command

In this tutorial we learn how to use cksum command in Linux. cksum command will print the checksum and byte size of a file.

What is Linux cksum Command?

In this tutorial we learn how to use cksum command in Linux. cksum command is a Linux command which do checksum and count the bytes in a file

cksum Syntax

cksum [FILE]...
cksum [OPTION]

cksum command linux example

To use cksum we only need to pass the filename to the command. For our exercise let’s create a new file using echo command below

echo "Hello Howtodojo!" > hello

Now let’s check the checksum of the new file named hello that we just create

cksum hello 
3769020071 17 hello

The first column of the output above is the checksum, The second column is the byte size. Since the text we enter on the hello file consists of 17 characters so it’s 17 bytes in size. The last one is the file name.

cksum Command Manual / Help

We can use man and info command to see the manual page of cksum command.

cksum command also have

--help option to show list of options.

man page of cksum command can be opened using command below. To exit man or info page you can press q.

man cksum

info page of cksum command can be opened using the command below.

info cksum

help page of cksum command can be printed using the command below.

cksum --help

Linux cksum Command Source Code

You can find cksum command source code from the folowing repositories:

You can read tutorials of related Linux commands below:

Summary

In this tutorial we learn how to use cksum in Linux with practical examples. Visit our Linux Commands guide to learn more about using command line interface in Linux.