Sponsored Content
Full Discussion: cksum command usage
Top Forums UNIX for Dummies Questions & Answers cksum command usage Post 302181706 by Axis99 on Thursday 3rd of April 2008 06:47:24 PM
Old 04-03-2008
cksum command usage

Hi All,

I am using cksum command in s script to check integrity of set of files transffred across the network.

What are the advantages and disadvantages/limitations of this command?
Is the byte count return reliable?
What are the other alternatives I could use for this purpose?

Appreciate your idea.

Thanks and Regards,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Anyone know how cksum works?

hello all. I'm not asking about the algorithm - or how it goes about computing the checksum - I'm asking how it views/looks at the files it does the cksum on. For instance: Say you had a directory named "dir_A" And within this directory you had some files. So: dir_A - file1 -... (5 Replies)
Discussion started by: kapolani
5 Replies

2. Shell Programming and Scripting

The cksum Problem

Hi, I have a working script, well it works on my machine but when I try it on others the cksum section does not work properly (I know the scripting is not of a high quality but I'm just trying to get it working) Heres the script: #!/bin/sh case $# in 0) echo "usage: enshar filename... (7 Replies)
Discussion started by: Dim-Wit
7 Replies

3. Shell Programming and Scripting

using cksum

hi, I am trying to use the cksum feature in unix. when i make a call to it i get returned something along the lines of: 4603435 14 file3 how do i get the first part of this response only; i.e: 4603435 I'm trying to use at a way without the use of sed and creating temp... (4 Replies)
Discussion started by: leeRoberts2007
4 Replies

4. UNIX for Advanced & Expert Users

Cksum dependencies

Hi, On what factors does the cksum depend. If i build 2 machines exactly the same, then can i get the checksum of 2 compiled files same. Thanks (3 Replies)
Discussion started by: vibhor_agarwali
3 Replies

5. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

6. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

7. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

8. UNIX for Dummies Questions & Answers

command to find cksum of all files inside a directory?

I did this: ls -lrRt | grep ^* | cksum * but it is showing cksum of sub-directories. Thanks You Please use code tags when posting data and code samples, thank you. (3 Replies)
Discussion started by: ezee
3 Replies

9. Shell Programming and Scripting

cp -v command usage?

I am trying to output a log file from cp usage. I think this can be achieved. In my code I have this. cp -i -v ~/files/* ~/backups/oldfiles/;; > ~/logs/logfile.logThe error I get is "syntax error near unexpected token '>' What am I missing? (7 Replies)
Discussion started by: gameinn
7 Replies

10. UNIX for Dummies Questions & Answers

Usage of '.' in MV command

Hi, Could you please let me know, why we should not use '.' in move command, if we use it, is it something wrong.. Please share the details on it. /home/rahualux/emp.csv /home/rahualux/details/employee_files/. Or other example for mutlipile files /home/rahualux/*.csv... (3 Replies)
Discussion started by: rahualux
3 Replies
cksum(1)						      General Commands Manual							  cksum(1)

NAME
cksum - Displays the checksum and byte count of a file SYNOPSIS
cksum [file...] STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: cksum: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
None OPERANDS
The path name of a file to be checked. If no file is specified, standard input is used. DESCRIPTION
The cksum command reads the files specified by the file argument and calculates a 32-bit checksum Cyclic Redundancy Check (CRC) and the byte count for each file. If no files are specified, standard input is read. The checksum, number of bytes, and file name are written to standard output. If standard input is used, no path name is printed. The cksum command can be used to compare a suspect file copied or communicated over noisy transmission lines against an exact copy of a trusted file. The comparison made by the cksum command may not be cryptographically secure; however, it is unlikely that an accidentally damaged file will produce the same checksum as the original file. [Tru64 UNIX] The cksum command uses a different algorithm than the sum command to calculate the 32-bit checksum CRC. The cksum command uses a CRC algorithm based on the Ethernet standard frame check. In addition, the sum block count is an octet count in cksum. [Tru64 UNIX] The IEEE Std 1003.2-1992 and X/Open CAE specifications require a slightly different method of calculating checksum values. To obtain these new standards, set the environment variable CMD_ENV to xpg4 as follows: export CMD_ENV=xpg4 [Tru64 UNIX] To maintain compatibility if the environment variable CMD_ENV is not set, the default action of the cksum command reports the traditional checksum values. The CRC checksum is obtained in the following way: The encoding is defined by the generating polynomial: G(x) = x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1 Mathematically, the CRC value corresponding to a given file is defined by the following procedure: The n bits to be evaluated are consid- ered to be the coefficients of a mod 2 polynomial M(x) of degree n-1. These n bits are the bits from the file, with the most significant bit being the most significant bit of the first octet of the file and the last bit being the least significant bit of the last octet, padded with zero bits (if necessary) to achieve an integral number of octets, followed by one or more octets representing the length of the file as a binary value, least significant octet first. The smallest number of octets capable of representing this integer is used. M(x) is multiplied by x^32 (that is, shifted left 32 bits) and divided by G(x) using mod 2 division, producing a remainder R(x) of degree less than or equal to 31. The coefficients of R(x) are considered to be a 32-bit sequence. The bit sequence is complemented and the result is the CRC. EXIT STATUS
The following exit values are returned: All files were processed successfully. An error occurred. EXAMPLES
To display the checksum and the size, in bytes, of file1 and file2, enter: cksum file1 file2 3995432187 1390 file1 3266927833 20912 file2 This output shows that the checksum of the file1 file is 3995432187 and contains 1390 bytes, and that the checksum of the file2 file is 3266927833 and contains 20912 bytes. ENVIRONMENT VARIABLES
The following environment variables affect the execution of cksum: [Tru64 UNIX] If this variable is set to xpg4, the method of calculating checksum values specified by IEEE Std 1003.2-1992 (POSIX.2) and X/Open CAE specifications is used. Provides a default value for the inter- nationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization variables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: sum(1), wc(1) Standards: standards(5) cksum(1)
All times are GMT -4. The time now is 06:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy