ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have searched diligently but can't seem to find a way to search by exif date. Most of my searches turned up commands to manipulate EXIF data not just search by it.
I have found some likely tools but suspect that I don't know enough bash to recursively find a .jpg file by it's exif date.
For example, exiprobe and exifgrep look promising (see examples below).
i have made some progress. At first, I couldn't associate the file name with the date given but learned that the "n" option forces each output line to start with the file name.
Now, I need to make the command recurse but can't seem to manage it. Any help would be appreciated.
You could apply this same technique to the other EXIF extraction programs too.
The find looks for jpg files. For each file found, it executes a shell which does a test on the exif data. The exif flags are '-t' which selects the DateTimeOriginal tag, and '-m' to show only the tag data. The match is a regular expression (in this case all January 2005 dates). If the exec match succeeds, the find goes on to print the filename.
Thanks for your quick response.
This looks really close but it appears that my Ubuntu hides the bash some place unexpectedly. I got an error messsage
Quote:
sh: [[: not found
. I searched for possible explanations and most seemed to suggest a permission issue. Assuming this might be a permissions error, I
ran the command under sudo with the same results.
That error is not telling you that is cannot find bash -- it's saying that "[[" is not found.
I would think (but not certain) that /bin/sh would be linked to /bin/bash on your system, thereby allowing the "[[" test (which is a 'Bashism') to execute without error; but as a test, you might try replacing the "sh" in your `find` command, with "bash" instead, and see if it likes that.
Alternately, you might try replacing the "[[" with "[" but my fear is that you would then need to do some quoting of the items within the [ and ] brackets.
So, in short:
1) try replacing "sh" with "bash".
2) if that fails, replace "[[" with "[" (and of course, replace "]]" with "]" as well) and see what happens there. If you try this, you may then get an error about "too many arguments.." which means you will need to, at the least, put qoutes around the things you are testing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.