The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
using cksum leeRoberts2007 Shell Programming and Scripting 4 05-31-2007 10:30 PM
The cksum Problem Dim-Wit Shell Programming and Scripting 7 08-15-2006 03:03 PM
cksum question rjsha1 Shell Programming and Scripting 4 01-17-2006 11:44 AM
Tag Release no. to Executables vibhor_agarwali UNIX for Dummies Questions & Answers 4 02-28-2005 05:42 AM
cannot create executables stufine UNIX for Dummies Questions & Answers 6 01-23-2003 04:43 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-17-2002
crazykelso crazykelso is offline
Registered User
  
 

Join Date: Jul 2002
Posts: 7
cksum all executables on drive

I know I can run the cksum command for multiple files in a directory and send the results to a new file.

EX.)
# cd /usr
# cksum *_ex* > /tmp/cksumusr.txt

But I can't figure out how to run this command on multiple files in all directories on drive. Is it possible to do this, without having to manually type these commands for every directory on my drive, and how would I go about it.

If you could help me I would appreciate it.
Thanx
  #2 (permalink)  
Old 07-17-2002
Kevin Pryke Kevin Pryke is offline
Registered User
  
 

Join Date: Feb 2002
Location: Bradford, UK
Posts: 70
cksum `find /usr -name "*_ex*" -print` > /tmp/cksumusr.txt

The `find ...etc...` bit is executed first & supplies the file names for cksum to work on. The output is then redirected to /tmp/cksumusr.txt
  #3 (permalink)  
Old 07-17-2002
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
If you wanted to do all filesystems - also added options to the find command to only check regular files which are executable.
(Note: the df -kl in Solaris shows only local filesystems - you may have to change this on your OS )

#!/bin/ksh
localfs=`df -kl |grep dsk | awk '{print $6}'`
cat /dev/null > /tmp/sum.junk
for i in $localfs; do
cksum `find $i -name "*_ex*" -type f -perm -o+x -print` >> /tmp/sum.junk
done
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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




All times are GMT -4. The time now is 10:09 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0