Results 1 to 3 of 3

Thread: find execdir convert -resize "find: missing argument to `-execdir'"

  1. #1
    Join Date
    Nov 2008
    Location
    California, USA
    Beans
    194
    Distro
    Ubuntu 13.04 Raring Ringtail

    find execdir convert -resize "find: missing argument to `-execdir'"

    ok, i'm trying to resize my album art that is dispersed through various artist/album folders. They are mostly 200x200, but i want to make all of them the same size. The code i'm trying to use is,

    Code:
    find -iname "cover.jpg" -execdir convert -resize 200x200 {}
    or
    Code:
    find -iname "cover.jpg" -execdir convert {} -resize 200x200
    i'm getting the error,
    Code:
    find: missing argument to `-execdir'
    on both

    can someone tell me whats wrong with my syntax. or am i doing something that's impossible?

  2. #2
    Join Date
    Feb 2007
    Beans
    4,045
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: find execdir convert -resize "find: missing argument to `-execdir'"

    You have to tell find where the command ends. You do that with a semicolon, which needs to be escaped from the shell (since ; has a special meaning in the shell). Newer implementations of find also provide a different end-character, +, which makes it pass as many files into one command as possible. In your case, since you want to resize the images in place, that's a wanted feature.

    Please make sure to try this out on a test-tree first, and that you have a backup, because it will overwrite the original files, with no chance of recovery if it fails.
    Code:
    find . -iname "cover.jpg" -exec mogrify -resize 200x200 {} +
    See http://mywiki.wooledge.org/UsingFind for a guide on using find.

  3. #3
    Join Date
    Nov 2008
    Location
    California, USA
    Beans
    194
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: find execdir convert -resize "find: missing argument to `-execdir'"

    oh, i see about the ; there. thanks! I don't recall seeing that in the manual, but that website cleared things up thanks.

    and running the command in a test tree first is a good idea. thanks a lot!

Tags for this Thread

Bookmarks

Posting Permissions

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