Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


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 !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-28-2012
Registered User
 
Join Date: May 2009
Posts: 133
Thanks: 23
Thanked 0 Times in 0 Posts
Using find -exec with multiple commands :(-

Hi all,

Am wanting to do a ls -l of the files and do a cat of it at the same time, ideally, I am hoping that the following work but obvisouly it is not working to what I am wanting it to ... hu hu hu


Code:
 
find . -name "BACKUP_TIMESTAMP.log" -exec "ls -l basename {} ; cat {}" \;

BACKUP_TIMESTAMP.log are one-liners that contain the date and time of when the backup was taken.

From the find syntax above, I guess the experts/gurus would know that am wanting to be able to a ls -l and then cat the content of the files found.

Can anyone suggest how I can get this to work the way that I want it to?

Thanks in advance.
Sponsored Links
    #2  
Old 06-28-2012
Registered User
 
Join Date: Mar 2012
Posts: 18
Thanks: 8
Thanked 1 Time in 1 Post
Try this


Code:
 
find . -name "BACKUP_TIMESTAMP.log" -exec ls -l {} \; -exec cat {} \;

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
find -exec with 2 commands doesn't work (error incomplete staement) llagos UNIX for Advanced & Expert Users 3 09-23-2011 11:59 AM
How to run multiple piped commands in a find -exec statement? DJR UNIX for Dummies Questions & Answers 3 08-02-2011 10:59 AM
find command to use multiple -exec options prasanna1157 Shell Programming and Scripting 1 09-26-2010 07:59 PM
Execute multiple commands in a find prismtx Shell Programming and Scripting 2 01-05-2009 03:39 PM
Exec. commands in python J.P Shell Programming and Scripting 1 12-19-2001 03:56 PM



All times are GMT -4. The time now is 09:39 PM.