LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-10-2004, 01:31 PM   #1
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
Question cksum problems


I have question. I need to use cksum on all files inside different direcotries. Basically i need it to do it recursively. I checked out cksum man pages and theres no options like for examples: cksum -r

At least my cksum doesnt support any options besides 'cksum --help' and 'cksum --version'

Basically i need cksum to give me checksum files and go down through directories like 'ls -R' would. Any thoughts on this matter would be appreciated, thank you
 
Old 01-10-2004, 01:36 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
You could use find:
find /path/to/base/dir -type f -exec cksum {} \;
 
Old 01-10-2004, 10:33 PM   #3
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
that command doesnt really work for some reason. I wonder if maybe theres another way? I dont really need to search or find specific file i just need to get all file checksums in different directories. Thanks again
 
Old 01-11-2004, 07:48 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It should work - what error do you get?
 
Old 01-11-2004, 12:48 PM   #5
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
wait no my fault it does work thanks alot david_ross. Quick question though what does this mean?

-type f and {} \;

in this command

find . -type f exec cksum {} \;
 
Old 01-11-2004, 01:43 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
The answers can be found in the man page:
man find

Basically it will only look for files of type f (these are ordinary files, not symlinks or directories). The {} is used in an exec statement and will be replaced, in turn, by the name of each file matched by the find comamnd.
 
Old 01-11-2004, 06:31 PM   #7
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
thanks alot david i appreciate the help
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ethernet Adsl Modem Driver Problems And Install Problems... akhilnair Linux - Hardware 12 11-28-2004 08:19 AM
cisco 350 wireless problems and suse x-server problems incognito9 Linux - Wireless Networking 5 10-14-2004 07:53 AM
cksum & md5sum fingerprints change after backup/restore to st cougar694u Linux - Software 3 06-22-2004 09:38 AM
Problems, problems, problems. Lets start with the soundcard Kre8ive Linux - Newbie 5 08-07-2003 01:20 AM
Problems, problems, problems. Lets start with the ES 1868 AudioDrive Kre8ive Linux - Newbie 1 08-06-2003 07:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:09 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
Open Source Consulting | Domain Registration