[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedOctober 11, 2023

How to use cksum command in Linux.

How To Use Cksum Command In Linux.

On Linux there are so many essential commands to perform various tasks or install the applications. One of the essential commands is cksum command which you can use to display a CRC (Cyclic Redundancy Check) value, the byte size of the file to standard output. In this article how you can use the cksum command in Linux.

You can follow the examples mentioned below to know how you can use cksum command in Linux:

To get the byte size and cksum of a text file execute the command by using the format given below:

cksum <file-name>

For example, I have executed the command using the above format of the file named as example.txt:

cksum example.txt

Now edit the file to change the data inside it by using the format given below:

sudo nano <file-name>

For example I have executed the command using the above format of the file named as example.txt to edit the data inside the file:

sudo nano example.txt

Executing the given below cksum command you can check the byte size of the edited file:

cksum example.txt

You can see the amount of data and checksum have changed than that of the previous file.

You can use cksum command for two files by using the command format mentioned below:

cksum <file name> <file name>

Using the format given above I have executed the following command to check the amount of data and checksum for the files example1.txt example2.txt:

cksum example1.txt example2.txt

As you know the cat command is used to read the data from a file, so when you execute the command by using the format given below, it reads data from the file and give you the checksum and data size of the file:

cat <file name> | cksum

I have used the example1.txt file to execute the command using the format given above:

cat example1.txt | cksum

When you execute the given below command on the command line terminal it will give you the option to write data of your choice:

cksum

You can also use the find command and cksum command together to list all the files in any directory and output the CRC on all the files in that directory by executing the command mentioned below:

find . -iname "*.txt" -exec cksum {} \;

 

About cksum Command Line Tool

You can check the version of cksum tool by executing the command given below:

cksum --version

You can check get the help of cksum tool by executing the command given below:

cksum --help

 

Conclusion

You can know the Cyclic Redundancy Check and byte size of a file by using cksum command.

Keep reading
How to use logname command in Linux.
October 11, 2023

How to use logname command in Linux.

How To Use Logname Command In Linux. In the world of Linux and Unix-based systems, the command-line interface is a powerful tool that allows users to interact with the system efficiently. One such command that might not be as well-known as some others is “logname.” This command is a utility for…

Read article
How to use xdg-open command in Linux.
October 11, 2023

How to use xdg-open command in Linux.

How To Use Xdg-Open Command In Linux. Linux is renowned for its flexibility and powerful command-line tools, and the xdg-open command is no exception. xdg-open is a versatile utility that simplifies the process of opening files, URLs, and applications on a Linux system. In this article, we will…

Read article
How to use uniq command in Linux.
October 10, 2023

How to use uniq command in Linux.

How To Use Uniq Command In Linux. Linux command-line tools offer a wide range of functionality to help users manage and manipulate text data efficiently. One such utility is the uniq command, which is used for identifying and removing duplicate lines from text files. In this article, we will…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00