Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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'm not afraid of bash but I'm not very good with it either. I'm assuming there's a way of using find, perhaps in conjunction with another tool, to find images in a directory (and subdirectories) based on their dimensions?
Specifically, I want to find all the landscape-oriented images and copy them somewhere else.
I adjusted it to simply compare the X dimension of the image with the Y dimension; if X is larger, copy the image somewhere else. You'd need to put the right path to your target directory, and adjust the -name parameter to the `find` command to search for the filename pattern you desire.
I haven't tested it so maybe try it on a test directory first, though it won't delete anything by accident even if it doesn't work as expected.
You'll need ImageMagick tools installed to have the `identify` command.
Thank you very much for your reply, Celine! I'm very grateful for your help. I don't know what most of that code means so I'll do some reading up on it, and I'll let you know if it works.
No problem - any questions, just ask and I or someone will try to answer. The only man pages you need to reference (besides Bash itself) are for the `find` command, as well as `awk` and `identify`. The awk commands just return the desired column (field) of each input, so to see the effect of this, try in a console, using the `identify` command by itself on a picture; then, try it but pipe it into some awk and see what comes out. You should then understand about the fields.
EDIT: Oh, and there's the `cp` command of course, so if you want to use a different `cp` syntax, check the `cp` manpage too.
Anyhow, any questions, feel free to ask.
Cheers!
Last edited by GrapefruiTgirl; 11-05-2010 at 01:29 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.