Grep output

Hi.
I have a command line that will generate exif data from .jpg files...
So to get the Camera Model I use:

find -iname "*.jpg" -print0 | xargs -0 exiftool -a | grep "Camera Model"

But I want the file name AND the camera model... How to I get the grep to give me TWO bits of information from the output???

All help gratefully accepted.

---------- Post updated at 05:01 PM ---------- Previous update was at 04:46 PM ----------

I suppose the real question is really: regardless of what information is being input to grep, how (or can you) extract more than one item of data from that input?

Use egrep .

find -iname "*.jpg" -print0 | xargs -0 exiftool -a | egrep 'Camera Model|File Name'
1 Like

Thanks Smurphy! It's a LONG time since my basic Unix days. I completely forgot about egrep!