Search code examples
shellfindexiftool

How can I locate a file and use exiftool from one command line


I am using Linux and I'd like to be looking at a file manager window, see a file I want to remove the exif data for, then open a terminal and quickly locate the file and remove the exif data in one easy command rather than navigating to the folder first (I have long dir hierarchies and don't always know the path to them).

It seemed like this below should have worked, but it didn't. Am I on the right track or barking up the totally wrong tree?

find /media -name "happy-hamster.jpg" | exiftool -all=

I can do this instead:

cd /media/typing/out/my/really/long/path/to/the/image/here/
exiftool -all= happy-hamster.jpg

But I'm wondering if there's an easier way: one line, using only the filename.


Solution

  • find /media -name "happy-hamster.jpg" -exec exiftool -all= '{}' \;