LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-06-2003, 01:19 AM   #1
daveeldredge
LQ Newbie
 
Registered: Jul 2003
Posts: 2

Rep: Reputation: 0
md5sum command


I'm having trouble understanding the checking function in the md5sum command. When I just compute the number it spits out the right one, but when I try to -c it I get this error:

no properly formatted MD5 checksum lines found

I have the md5sum file to check against in the same directory. Are there any special rules about names or file formats?

I'm running Mandrake 9.1

Dave
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 07-06-2003, 05:18 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,568

Rep: Reputation: 164Reputation: 164
How do you compute the sums? Could you post the commands you use?
 
Old 07-06-2003, 07:17 PM   #3
daveeldredge
LQ Newbie
 
Registered: Jul 2003
Posts: 2

Original Poster
Rep: Reputation: 0
In the console, the command I'm using is:

md5sum -c filename

or

md5sum --check filename
 
Old 06-11-2004, 05:49 PM   #4
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 34
I know this is a late response, but this is to clarify the md5sum usage for the benefit of others.................

The basic syntax for md5sum is:
Quote:
md5sum [OPTION] [FILE] ...
md5sum [OPTION] --check [FILE]
When creating checksums for files, more than one filename may be used on the command line. And the manpage for md5sum doesn't clarify the FILE used for the --check option (or -c option), but it refers to the checksum list of files, not the files being checked.

To generate a MD5 checksum:
Code:
md5sum FILE
To check MD5 checksums against a list:
Code:
md5sum -c LIST
Also, the format for the MD5 checksum list isn't explained, either. It goes like this:
Code:
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn  FILE
The first part, with all the n's is the MD5 checksum number, in hexadecimal format, and the second part is the filename of the FILE. IMPORTANT: Each MD5 checksum and filename MUST BE SEPARATED BY TWO SPACES, not a single space or tab. Otherwise you'll get the infamous error "no properly formatted MD5 checksum lines found". Other lines, such as comments, may be included in the checksum file list. md5sum will simply ignore any lines that aren't properly formatted checksum lines.

You can easily create your own MD5 checksum list by redirecting the output of the md5sum output to a file:
Code:
md5sum FILE1 FILE2 FILE3 > CHECKSUM.MD5
This will produce a MD5 checksum file, called CHECKSUM.MD5, with properly formatted checksum lines for each file.

Hope that helps clarify things a little since, in this case, the md5sum documentation is _not_ very clear on the matter.

---thegeekster

Last edited by thegeekster; 06-11-2004 at 08:42 PM.
 
2 members found this post helpful.
Old 12-20-2006, 06:00 AM   #5
geoff_f
Member
 
Registered: May 2003
Location: Canberra, Australia
Distribution: openSUSE 11.3
Posts: 445

Rep: Reputation: 31
The response might have been somewhat late, but it's still valid and relevant to me, some two years later. I've been downloading multiple files with their md5sums and trying to compile a checksum list file so that I could check all of their md5sums in one go, rather than doing each individually. However, I couldn't get it to work, getting the 'no properly formatted MD5 checksum lines found' error message. man, info and Google were of little help in finding out exactly what format md5sum expects, but a search here on LQ brought up this little gem. Thanks to thegeekster, and the time and trouble taken in posting such a clear explanation, my problem is solved.
 
Old 06-26-2008, 08:54 PM   #6
haridsv
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Rep: Reputation: 0
Thanks to thegeekster for taking the time to explain the format. I kind of guessed that the output of md5sum would be the right format as input for --check, however when I fed the output generated by cygwin md5sum to the one on debian, it didn't recognize with this error. It turns out, the cygwin md5sum produced output with a single space as separator, so I just added one more space and it is happy.
 
Old 06-26-2008, 10:13 PM   #7
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Unfortunately, this stupid white space requirement between the fields of themd5sum checksum file bites many. Here we are in 2008, with > 60 years of computing experience, and we programmers are still stubbornly forcing users to conjure spells just the right way before we'll perform the magic. The cost by shear waste of time due to these idiosyncrasies exceed the GNP for many small countries. Sigh.
 
Old 06-26-2008, 11:37 PM   #8
dickynofyanh
LQ Newbie
 
Registered: Jun 2008
Posts: 1

Rep: Reputation: 0
Help Me

help me pls , i can a problem at instalation driver network in slackware 12 and the driver is succeed to install step by step, but lan card not on and when type ping localhost its run, ifconfig ok no problem, but type ifconfig
to another ip is list destination host unreachable.
 
Old 06-26-2008, 11:51 PM   #9
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
New thread please.
 
Old 07-12-2008, 06:18 PM   #10
haridsv
LQ Newbie
 
Registered: Jun 2008
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by Mr. C. View Post
Unfortunately, this stupid white space requirement between the fields of themd5sum checksum file bites many. Here we are in 2008, with > 60 years of computing experience, and we programmers are still stubbornly forcing users to conjure spells just the right way before we'll perform the magic. The cost by shear waste of time due to these idiosyncrasies exceed the GNP for many small countries. Sigh.
Sorry for posting incorrect information before. For the sake of record I must clarify that the output of cygwin md5sum was accepted as it is on linux. The reason I thought it didn't accept earlier was because I had to edit the output file and while doing so messed it up. I had to edit the file because I had to change the names of directories to account for their difference in the destination, and while doing so, somehow thought the asterisks in front of each file name was extraneous and removed them (now I know from the man page what they mean). I was then left with a single space and got into the format issue. After realizing from this thread that there should have been two spaces, I just added one extra space and that made the format acceptable, but still check failed for every file. Even after replacing the space with asterisk, the check didn't still go through. It seems like the checksum produced by md5sum on cygwin and linux are different for the same file. First I copied over network from windows to linux and verified that the checksums are different. Thinking there is some issue with the network copy, I connected the drive as an external USB drive and ran md5sum over the mount and got different checksums than on the windows m/c. At least now the checksum's on linux match with that of the copy, at least for some of the files, not sure why it won't for others. I may have to copy them again and try.
 
Old 12-17-2008, 12:42 AM   #11
emekeret
LQ Newbie
 
Registered: Dec 2008
Posts: 1

Rep: Reputation: 0
First of all hello to LQ community.
and here is my add to this post as a linux newbie:
if you are using emelfm with "For Each" plugin:
just select all files you want to be md5s' generated
and right click then "Plugins" then "For Each"
and enter this action in:
Code:
md5sum >> checksums.md5
it starts to calculate md5 of all files you selected and writes into the cheksums.md5 file.

Last edited by emekeret; 12-17-2008 at 04:06 AM. Reason: spellcheck
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MD5SUM How to use it Baz Linux - Newbie 10 11-12-2013 11:39 AM
cp changes md5sum kel_en Mandriva 0 07-05-2005 09:44 AM
Help with MD5SUM Smokeball Linux - Newbie 3 08-30-2003 11:45 PM
Md5sum? Shabadu Linux - General 2 07-22-2003 01:51 PM
Md5sum ? mikeshn Linux - General 6 07-03-2003 12:09 PM


All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration