|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
Try this Code:
find . -name "BACKUP_TIMESTAMP.log" -exec ls -l {} \; -exec cat {} \; |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| 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 |
|
|