3

Find Image With Specific Dimension Using Command Line

 2 years ago
source link: http://siongui.github.io/2021/12/19/find-image-with-specific-dimension-command-line/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Find Image With Specific Dimension Using Command Line

December 19, 2021

Question:

Find JPEG images with size 1080x1920 using Linux command line tool.

Answer:

Install ImageMagick:

$ sudo apt-get install imagemagick

Use the following command to find all *.jpg files with size 1080x1920: [1]

$ find . -iname "*.jpg" -type f -exec identify -format '%i %wx%h\n' '{}' \; | grep '1080x1920'

To move the 1080x1920 *.jpg files to another directory, run: [2]

$ find . -iname "*.jpg" -type f -exec identify -format '%i %wx%h\n' '{}' \; | grep '1080x1920' | sed -e "s/ 1080x1920$//" | xargs -I {} mv {} /path/to/destination/directory/

References:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK