Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExifTool output file name

Tags:

exiftool

I'm trying to search hundreds of files for the keyword 'Description' and then output the name of a file that contains the keyword.

Executing a simple exiftool * | grep Description (in UNIX) gives me the line in the file but not the name of the file that contains the line. By default, the file name and description are output on two separate lines like the two below.

File Name                       : [Name of file listed here]
Description                     : [a long string here]

I think there's a way to do this in ExifTool without even needing to pipe the output to grep but I haven't been able to figure it out.

like image 974
dfyoung Avatar asked Oct 17 '25 18:10

dfyoung


1 Answers

There are lots of ways to do this. Here is one:

exiftool -if '$description' -filename -r .

or if you want both the file name and description on the same line:

exiftool -p '$filename $description' -r -q -q .

and if you also want the directory:

exiftool -p '$directory/$filename $description' -r -q -q .

  • Phil
like image 50
PhilHarvey Avatar answered Oct 21 '25 02:10

PhilHarvey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!