Create md5 sums and archive the resulting md5 files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Create md5 sums and archive the resulting md5 files
# 1  
Old 09-11-2011
Create md5 sums and archive the resulting md5 files

Hello everyone,

I am looking to basically creating md5sum files for all iso files in a directory and archive the resulting md5 files into a single archive in that very same directory.
I worked out a clumsy solution such as:

Code:
#find files for which md5sum are to be created and store the resulting md5sum in a particular file
find ./ -name "*.iso" |
while read F
do
	G=$(echo "$F".md5 | sed 's/^..//')
	md5sum $F > $G
done

#create the tar archive with the new created md5 files
tar -cvf archive.tar *.md5

#remvove the md5 files
rm *.md5

but I am not satisfied by the result since:
1- it actually writes the temporary md5 files that I need to remove after the archive is done
2- it is clumsy

I feel that this whole thing can be wrapped in a single line command, but fail to see how to do.
Any help would be appreciated.

Regards,
# 2  
Old 09-11-2011
If you want to keep md5sum-s in separate files then there is no better way. But maybe it is enough:
Code:
find -name '*.iso' | xargs md5sum >md5list.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to reverse the b64 format(encoded b64(b64(md5($pass)))) into md5 hash format?

I have about 1500 rows (encoded b64(b64(md5($pass))) algorythm) in a file. I would like reverse the b64 into md5 hash format. How could I do that from command line? So I need only the correct md5 hash formats. These row format: 4G5qc2WQzGES6QkWAUgl5w P9tKxonBOg3ymr8vOBLnDA... (1 Reply)
Discussion started by: freeroute
1 Replies

2. Shell Programming and Scripting

Need to create a simple script using MD5, SSH...

Hi all, I am brand new to these forums and I am a brand new UNIX Administartor. Don't know any scripting yet :wall:, and would like to learn as my boss is slowly letting me understand everything about being a Sys/*Nix Admin. He created this script which I am trying to replicate because I lost it... (54 Replies)
Discussion started by: zixzix01
54 Replies

3. Shell Programming and Scripting

Generating MD5's of files

On my website I host a lot of files, and when people view the site, currently each time the page loads, I have PHP generating the md5 sums for the files right then and there. It was fine when my site was small, but now that's obviously very inefficient. Now I'd like to start generating MD5 sums... (4 Replies)
Discussion started by: GrdLock
4 Replies

4. Shell Programming and Scripting

Help with md5 in PERL

I am a newbie in programming in Perl. My problem is that this unix command is embedded in Perl but it gives an empty output. Here's the code: $temp = `md5 "../Directory String/..." | awk {'print $NF'} > "../Directory/file.txt"`; The output file should contain the md5 hash value of the... (2 Replies)
Discussion started by: ianebaj
2 Replies

5. Linux

Need Help: MD5

I am trying to compare two identical files by using md5 command, but cant get the right command parameters Please help me with any examples. All I want is to know how to compare two identical files which are residing on two different machines in my local network, for example: Host_A -... (6 Replies)
Discussion started by: greenja
6 Replies

6. UNIX for Dummies Questions & Answers

MD5 missmatch

I think it's a problem of gtar, but i'm note sure... I use gtar to create an archive from a directory then i use md5 to get an md5 string for the archive bzip2 to compress the archive and md5 again for the compressed archive. I send the file to my backup machine. When i download the... (1 Reply)
Discussion started by: noratx
1 Replies

7. UNIX for Dummies Questions & Answers

Hashing or MD5

Hi, how can one find that which encryption algorithm the system is using for keeping the user password in the /etc/passwd or /etc/shadow file. Is it 1: Hashing ( which considers only first 5 letters of password) 2: MD5 (Which allows arbitry length passwords) Thanks, ~amit (0 Replies)
Discussion started by: amit4g
0 Replies

8. Shell Programming and Scripting

How to create md5 Hash variable?

I have a script that runs the grub-md5-crypt command based on whether the pass_value variable is a non-zero string. The md5 hash is being created in the /opt/hostconfigs/$HOST file, but I can't echo $md5_value. It is blank. Is there a way to create and echo a md5 hash variable? if then... (1 Reply)
Discussion started by: cstovall
1 Replies

9. UNIX for Advanced & Expert Users

Digest MD5

Dear Guys , Am sorry i ask alot , but i do not know that much about perl , cgi , MD5 ! now i installed MD5 and Digest MD5 to my solaries 7 sparc machine . when i execute the command : $perl Makefile.PL i get the follwoing error message ,, please tell me how to fix it , i need... (11 Replies)
Discussion started by: tamemi
11 Replies

10. Shell Programming and Scripting

Md5

Does anyone know a scipt that includes MD5. I need to run a script that includes MD5 encryption. Thanks (1 Reply)
Discussion started by: duncang3
1 Replies
Login or Register to Ask a Question