LinuxQuestions.org
Visit Jeremy's Blog.
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 11-02-2010, 01:31 PM   #1
clifford227
Member
 
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282

Rep: Reputation: 64
sha1sum a folder and files?


Is there anyway to make a hash (or similar), of a folder of files, for data integrity purposes?

I tried with sha1sum, but it cant do it.

Is it possible with some other software?

Last edited by clifford227; 11-02-2010 at 01:32 PM.
 
Old 11-02-2010, 05:17 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Jessie (Fluxbox WM)
Posts: 1,388
Blog Entries: 52

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
You can do this with sha1sum, but there are some issues when trying to do this on a group of files.

For example, if you were just doing a bunch of files, you can do something like the following (where the '-' parameter tells sha1sum to use standard input):
Code:
sha1sum * | sha1sum -
That won't recurse into the subdirectories, or include the meta-data in the sum.

Or you could do something like this:
Code:
tar cO --mtime=0 . | sha1sum -
This will recurse, and include the meta-data. However, the checksum will be dependent on the order in which the files are collected, and you will have to perform the command from the same relative location. You might also want to change the tar parameters depending on which metadata should be included or excluded.

Last edited by neonsignal; 11-02-2010 at 05:25 PM.
 
Old 11-02-2010, 05:23 PM   #3
saavik
Member
 
Registered: Nov 2001
Location: NRW, Germany
Distribution: SLES / FC/ OES / CentOS
Posts: 611

Rep: Reputation: 32
http://sourceforge.net/projects/tripwire/

did a good job for me....
 
  


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
i need to copy files from one folder to another folder using shell anurupr Linux - Newbie 17 03-04-2010 09:07 AM
Impossible to change files attributes to all files in the folder maiden2 Linux - Software 1 09-30-2008 05:09 AM
How to automatically move files from one folder into another folder? xmrkite Linux - Software 6 11-05-2006 10:39 AM
sha1sum frolicchap Fedora 3 01-22-2006 06:48 AM
IglooFTP-PRO refuses to upload files in folder when I upload folder eBopBob Linux - Software 0 08-27-2004 05:52 AM


All times are GMT -5. The time now is 06:35 PM.

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