List image attributes from a folder of JPEG images

for file in *.jpg; do identify -format '%f %b %Q %w %h' $file; done
Runs the identify command (from ImageMagick) on each jpg file in the current directory and returns image details according to the format parameter. The example here returns: Filename FileSize Compression Width Height More information about the available format options can be found here: I usually redirect the output to a text file using "> listofdetails.txt" at the end. Spreadsheet magic can then be applied.
Sample Output
402670154.jpg 20095B 80 600 400
402670164.jpg 47173B 80 600 600
402670174.jpg 88055B 95 800 800
402680421.jpg 45769B 80 586 388
402680424.jpg 45769B 80 586 388
402680442.jpg 160137B 99 600 600

By: phattmatt
2012-11-16 10:06:35

What Others Think

for file in *.jpg; do identify -format '%f %b %Q %G' $file; done will also work
chrismccoy · 507 weeks and 5 days ago
Command-line has been a very prominent approach to work on your PC. This was the most secure way. But this was not an easy task to remember the commands. It would be a thousand statements and this personal statement writer is a good sign of working. These basic commands are good to do something fast. Otherwise, these days GUI has become more famous than the command line.
Hineed · 95 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: