Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

sum(1b) [sunos man page]

sum(1B) 					     SunOS/BSD Compatibility Package Commands						   sum(1B)

NAME
sum - calculate a checksum for a file SYNOPSIS
/usr/ucb/sum file... DESCRIPTION
sum calculates and displays a 16-bit checksum for the named file and displays the size of the file in kilobytes. It is typically used to look for bad spots, or to validate a file communicated over some transmission line. The checksum is calculated by an algorithm which may yield different results on machines with 16-bit ints and machines with 32-bit ints, so it cannot always be used to validate that a file has been transferred between machines with different-sized ints. USAGE
See largefile(5) for the description of the behavior of sum when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
sum(1), wc(1), attributes(5), largefile(5) DIAGNOSTICS
Read error is indistinguishable from EOF on most devices; check the block count. NOTES
sum and /usr/bin/sum (see sum(1)) return different checksums. This utility is obsolete. SunOS 5.10 8 Nov 1995 sum(1B)

Check Out this Related Man Page

sum(1B) 					     SunOS/BSD Compatibility Package Commands						   sum(1B)

NAME
sum - calculate a checksum for a file SYNOPSIS
/usr/ucb/sum file... DESCRIPTION
sum calculates and displays a 16-bit checksum for the named file and displays the size of the file in kilobytes. It is typically used to look for bad spots, or to validate a file communicated over some transmission line. The checksum is calculated by an algorithm which may yield different results on machines with 16-bit ints and machines with 32-bit ints, so it cannot always be used to validate that a file has been transferred between machines with different-sized ints. USAGE
See largefile(5) for the description of the behavior of sum when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
sum(1), wc(1), attributes(5), largefile(5) DIAGNOSTICS
Read error is indistinguishable from EOF on most devices; check the block count. NOTES
sum and /usr/bin/sum (see sum(1)) return different checksums. This utility is obsolete. SunOS 5.11 8 Nov 1995 sum(1B)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

calculate size of some files

Hi, 1-I want to calculate the size of all files which are generated during last month in a directory. How can I do that ? Of cours, I find them by : $ls -l | grep jun but how to calculate the sum of their size ? 2- the same but for all files generated last month and before that. many thanks... (11 Replies)
Discussion started by: big123456
11 Replies

2. Shell Programming and Scripting

sum(col) finding from a file

Hi I have an file which looks like country address phone amount sweden |address |phone | 10 | Singapo |address |phone | 20 | Italy-N |address |phone | 30 | denmar |address |phone | 40 | Here i need to do the sum(amount), how to do this in shell scripting Thanks Babu (11 Replies)
Discussion started by: ksmbabu
11 Replies

3. Shell Programming and Scripting

Read the data from multiple files and sum the value

Hi all, I have a requirement where i have to read multiple files using Shell Script in Korn Shell. each file will have the 3rd line as the amount field, i have to read this amount field and sum it for all the files. any idea on how to achieve this?? (i think i can achieve it using a loop,... (9 Replies)
Discussion started by: nvuradi
9 Replies

4. Programming

C language to calculate mean,variance

Here I want to calculate mean,variance and sum from a file 1.1*2*4*22*211*22*12*22*22*11 2.2*2*22*12*22*11*11*122*33*22 3.9*7*22*88*87*98*67*66*56*66*11 As this is a large file and i am trying to write in c where formulae of MEAN = 1/N (X1...+..Xn) Variance = square root of 1/N-1... (9 Replies)
Discussion started by: cdfd123
9 Replies

5. Shell Programming and Scripting

how to sum values from 2 different files?

Hi I am trying to add count values from two different files into one file. Could any body please suggest me best command to do this? My problem was as follows: a.txt b.txt c.txt 10 20 30(needed) i tried cat a.txt b.txt > c.txt (its not adding the values) Thanks in advance.. Praveen (8 Replies)
Discussion started by: npk2210
8 Replies

6. Shell Programming and Scripting

if condition doesn't work

i want to get the value for column 4rth when i =4. please guide what i am doing wrong. thanks var=`cat file.csv` for i in $var; do { if ; then var4=$var4+$i fi echo $i } done I am geting this error message "0403-009 The specified number is not valid for this command." (8 Replies)
Discussion started by: sagii
8 Replies

7. Shell Programming and Scripting

sum from ls -al |awk '{print $5}'

// AIX 5.3 & AIX 6.1 ls -al |awk '{print $5}' This gives each file's size in byte. I need to get: - the sum of all files in Giga bytes with loop. - excluding the size of directories (ls -al returns the size of directories). There are hundreds and thousands of files, so summing up... (8 Replies)
Discussion started by: Daniel Gate
8 Replies

8. Shell Programming and Scripting

Breaking the sum of a column when specific pattern is found

Hi Am trying to sum up a file # cat /Out maths 2 0.0 english 2091 0.2 history -1 0.0 physics 18 0.0 -------------------------------------- maths ... (9 Replies)
Discussion started by: Priya Amaresh
9 Replies

9. Shell Programming and Scripting

Sum Column Value

I have a requirement to sum all records in a column in a file and get the total sum value .There are 15 million records in the file.Data in the file has 2 decimal places. I use the below AWK function cut -d "," -f4 data.txt|awk ' {sum+=$1 } END { Printf("%.2f\n",sum)}' I get the below... (8 Replies)
Discussion started by: Rocket
8 Replies

10. UNIX for Dummies Questions & Answers

Match sum of values in each column with the corresponding column value present in trailer record

Hi All, I have a requirement where I need to find sum of values from column D through O present in a CSV file and check whether the sum of each Individual column matches with the value present for that corresponding column present in the trailer record. For example, let's assume for column D... (9 Replies)
Discussion started by: tpk
9 Replies

11. Shell Programming and Scripting

Need help the sum from loop

Hi all, I have one host i need to run in loop to check the capacity from different frame and get the output to one file and sum it and convert to TB this is Code #!/bin/ksh DATE=`date '+%d%m%y'` for f in `cat /home/esx-capacity/esx-host.txt` do for g in `cat /home/esx-capacity/frame`... (10 Replies)
Discussion started by: ranjancom2000
10 Replies

12. Shell Programming and Scripting

Do replace operation and awk to sum multiple columns if another column has duplicate values

Hi Experts, Please bear with me, i need help I am learning AWk and stuck up in one issue. First point : I want to sum up column value for column 7, 9, 11,13 and column15 if rows in column 5 are duplicates.No action to be taken for rows where value in column 5 is unique. Second point : For... (12 Replies)
Discussion started by: as7951
12 Replies

13. UNIX for Beginners Questions & Answers

Compare sum of two columns if variance is zero do nothing else send an email

11☺Hi, I have to data sets: One is in .txt format and other is in .csv format, please refer below two outputs from two files. File1.txt SOURCE PAYDATE TOTAL_DOLLARS RECORD_COUNT ASSET 05/25/2018 247643.94 ASSET 06/20/2018 ... (27 Replies)
Discussion started by: Tahir_M
27 Replies

14. Shell Programming and Scripting

Get the average of lines with the same first 4 letters

How to sum up and print into the next line the total SUM. ]$ cat hhhh aaa1a 1 aaa1g 2 aaa1f 3 baa4f 3 baa4d 4 baa4s 4 cddg1 3 cddg3 4 cddfg 1 $ cat hhhh|awk ' {sum+=$2} END {print sum}' 25 Desire output: aaa1a 1 (13 Replies)
Discussion started by: kenshinhimura
13 Replies

15. Homework & Coursework Questions

Sum of even numbers from 0 to 100 script

1. The problem statement, all variables and given/known data: Write a shell script that finds and display the sum of even positive integers from 0 to 100. Use the while control structure. Show your script and a sample run. 2. Relevant commands, code, scripts, algorithms: Must us a while... (8 Replies)
Discussion started by: Nastybutler
8 Replies