Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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 07:42 PM.
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.
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.
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.
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.
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.
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 03:06 AM.
Reason: spellcheck
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.