LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 08-10-2005, 11:25 AM   #1
solarmax
LQ Newbie
 
Registered: Nov 2004
Location: London, UK
Distribution: Ubuntu 6.06 Dapper Drake
Posts: 11

Rep: Reputation: 0
md5sum on a directory with lots of files.


Hi all,
I have been using linux for few years now. I found all the required answers by searching forums. I need to solve the following problem.

I have a folder (lets call it music) with lots of sub-folders in it (lets call it albums) , which has lots of files in each of them (they are music tracks). I have backed up my main music folder. Basically, I copied music folder to another hard disk. I want to md5sum the backup.

When i do the following command:
Code:
md5sum songs
it says:
Quote:
error processing songs: failed in buffer_read(fd): mdfile: Is a directory
I understand that md5sum only works for a file. Its unrealistic to check sums of each and every file separately.

long story short, how do i check md5sums for files in a folder recursively and print it out to a text file?
please tell me the name of the program. or any other method to do the job.

Thank you..

PS : I apologies in advance if this has been posted before..

Ubuntu linux 5.04.
kernel 2.6.10-5-k7
AMD AthlonXP 3000+
WinTV-PCI hauppauge TV card bt848
Mother board: ASUS some version
8mbps broadband..
yes 8mbps broadband.
 
Old 08-10-2005, 11:33 AM   #2
Matir
Moderator
 
Registered: Nov 2004
Location: Kennesaw, GA
Distribution: Ubuntu
Posts: 8,502

Rep: Reputation: 110Reputation: 110
Code:
find songs -type f | xargs md5sum
Where songs is the directory. That *SHOULD* work for you.
 
Old 08-10-2005, 11:38 AM   #3
solarmax
LQ Newbie
 
Registered: Nov 2004
Location: London, UK
Distribution: Ubuntu 6.06 Dapper Drake
Posts: 11

Original Poster
Rep: Reputation: 0
thanks for the quick reply..

when i input your code.. it says :
Quote:
xargs: unmatched single quote
i get something is wrong..
 
Old 08-10-2005, 12:46 PM   #4
Matir
Moderator
 
Registered: Nov 2004
Location: Kennesaw, GA
Distribution: Ubuntu
Posts: 8,502

Rep: Reputation: 110Reputation: 110
Hrrm, are you sure you copied my command line exactly? Do some of the files contain single quotes?

Try:
Code:
find songs -type f | xargs -i md5sum "{}"
 
Old 08-11-2005, 04:34 PM   #5
solarmax
LQ Newbie
 
Registered: Nov 2004
Location: London, UK
Distribution: Ubuntu 6.06 Dapper Drake
Posts: 11

Original Poster
Rep: Reputation: 0
Thank you very much Matir.. yes I do have some names with quote. Your code worked like a charm.

Quote:
find songs -type f | xargs -i md5sum "{}"
If someone else is reading this, i added the " > music.txt " at the end to print it in a text file. it is useful when you have several files to md5sums.

Code:
find songs -type f | xargs -i md5sum "{}" > music.txt
thanks again,
 
Old 08-11-2005, 05:22 PM   #6
Matir
Moderator
 
Registered: Nov 2004
Location: Kennesaw, GA
Distribution: Ubuntu
Posts: 8,502

Rep: Reputation: 110Reputation: 110
Yep. Or, of course, you could pass it off to a sort program, or whatever you wanted.

Glad it worked for you.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
comparing lots of files Frustin Linux - General 4 09-22-2005 02:54 PM
how to repair suse md5sum files...? enigmatech Linux - Newbie 3 08-05-2005 11:29 AM
Renaming lots of files Tuttle Linux - General 4 11-18-2004 11:15 AM
md5sum to check files? serendipitysdc Fedora - Installation 2 06-22-2004 08:12 PM
wiped out lots of files :( skull_crusher Linux - Newbie 0 04-10-2003 04:10 AM


All times are GMT -5. The time now is 05:38 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration