sum Command

Purpose

Computes and displays the checksum and block count of a file.

Syntax

sum [ -h ] [ -r ] [ -s ] [ -V ] [ File ... ]

Description

The sum command computes and displays simple 16-bit checksum and block count for files by using a traditional algorithm (System V or BSD style). In PowerVC virtual appliance, only read-only checksum computation is allowed for security. File modification or advanced hashing is not allowed.

Flags

Table 1. Flags
Item Description
-h or --help Displays help about the sum command.
-r Uses the Berkeley Software Distribution (BSD) sum algorithm to compute and display the checksum of a file.
-s Uses System V (SysV) sum algorithm to compute and display the checksum of a file. The -s flag returns simple byte sum with block size1024 bytes.
-V or --version Displays version information.
Note: If the sum command is used without any flags, by default SysV sum algorithm is used to compete the checksum of a file.

Examples

  1. To display the default SysV checksum of document.txt file, enter the following command:
    sum document.txt
  2. To display the BSD-style checksum of image.png file, enter the following command:
    sum -r image.png
  3. To display the checksum from the standard input (stdin), enter the following command:
    echo "hello world" | sum