Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Find files with populated Maker or Model EXIF data


    I'm quite new to UNIX based systems and command line. I am looking for a way to search a folder recursively for any images that has the Maker (if not maker then model) EXIF field populated. I then want to move these files to a new folder.

    I have used 'find' to delete all files under a certain size but I'm unsure how to apply this commamd to yield the above results.

    Any ideas for using 'find' (or any other command line program) or a script that will help me acheive this?

    Thanks in advance

  2. #2
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris

    Welcome to the forum.

    It seems to me that you need the following steps:

    1) Identify the correct kind of file, find will porbably help here,

    2) Use some program to locate and extract data from a tag field,

    3) Move appropriate files, mv is the basic command when you have identified a candidate

    I looked at , but I didn't see a tag named "Maker".

    A program named ExifTool however was mentioned and I found:
    Image::ExifTool is a Perl module with an included command-line application
    called exiftool for reading and writing meta information in a wide variety of
    files, including the maker note information of many digital cameras by
    various manufacturers such as Canon, Casio, FLIR, FujiFilm, GE, HP,
    JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Nikon, Nintendo,
    Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Phase One, Reconyx, Ricoh,
    Samsung, Sanyo, Sigma/Foveon and Sony.
    on a system I use:
    OS, ker|rel, machine: Linux, 3.16.0-4-amd64, x86_64
    Distribution        : Debian 8.4 (jessie)
    libimage-exiftool-perl: Installed: 9.74-1
    So, unless someone knows of a program that can do all that, you'll need to read and to experiment to put those things together in a script.

    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  3. #3

    So once upoun a time, I copied the simplest perl script for exif data extraction, I think I copied it write of the cpan page and it went like this:
    PHP Code:
    use Image::ExifTool qw(:Public);
    my $info ImageInfo("$ARGV[0]");
    foreach (
    keys %$info) {
    "$_ => $$info{$_}\n";

    Named that son of a farmer,

    Now to get this script to run you must install the module, either from your package manager or cpan, I did it from cpan:

    PHP Code:
    sudo cpan
    install Image
    And then I stuck that little tool in my /bin/ dir and I made it an executable(sudo chmod +x /bin/ And I just futzing forgot about it. Just forever...

    Until now. And I feel your plight, so if you do that, with then you can do this with find:

    PHP Code:
    find /home/theGoshDarnDeeber/ -name "*png" --name "*jpg" -exec {} \; 
    You know. put the dir you want to start in instead of " /home/theGoshDarnDeeber/ ". And this only finds png's and jpgs, but if you wanted to find and get the exif data of say, I don't know, cams as well you could:

    PHP Code:
    find /home/theGoshDarnDeeber/ -name "*png" --name "*jpg" --name "*cam" -exec {} \; 
    Sidenote: I haz no idea if cams have exif data.

    Side Side Note, if some of your extentions are wacking with CAPITALS, you may want to add like -o -name "*PNG" and et cetera, also.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts