sum command in Linux with Examples
sum command in Linux is used to find checksum and count the blocks in a file. Basically, this command is used to show the checksum and block count for each specified file. When no file is specified then it will read the standard input.
Syntax:
sum [OPTION]... [FILE]...
Example: It will ask for the input of the file we want to calculate the checksum. In the following example, we are calculating the checksum for myfile.txt.
Options:
- sum -r: This option will use BSD sum algorithm, use 1K blocks.
Example:
sum -r myfile.txt
- sum -s: This option will use System V sum algorithm, use 512 bytes blocks.
Example:
sum -s myfile.txt
- sum –help : This option displays the help text and exit.
sum --help
- sum –version : This option will show the version information and exit.
sum --version
Recommended Posts:
- cut command in Linux with examples
- tac command in Linux with Examples
- atd command in Linux with examples
- man command in Linux with Examples
- cpp command in Linux with Examples
- rev command in Linux with Examples
- cvs command in Linux with Examples
- w command in Linux with Examples
- cp command in Linux with examples
- last command in Linux with Examples
- help Command in Linux with examples
- dir command in Linux with examples
- ln command in Linux with Examples
- ex command in Linux with examples
- ar command in Linux with examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.








