While I was looking for a better image viewer than the default ‘eye of gnome’ (eog from the command line), that’s able to play animated gifs, I came across a command line tool called feh
feh is is lightweight image viewer that you can call from the command line. It can recursively view files with the following command for example:
You can navigate through the images with your arrow keys or space bar and backspace. Use the window close button or press esc to quit.
That’s all good and fun and I’ll probably use it from time to time but it’s not what really got me excited about this tool. It has an option for a “list” of image attributes as the screenshot below shows.

By typing for example
I would list all attributes for jpgs within a specified directory. In my screenshot, I had a text file multiple image extensions, so I did a subshell with an ‘ls’ command piped to ‘grep -v’ which negates whatever pattern that follows it. To rephrase, the command inside $() is run first and that list which has all files minus those ending in ‘.txt’ is called by the ‘feh -l’ command.
I find this very helpful for when I’m slicing images for web pages. When I’m typing out css for example:
#my_image {
display:block;
height:25px;
width:120px;
background:transparent url('img/my_image.png') 0 0 no-repeat;
}
it’s very handy to have the image dimensions. The nice thing about this raw dimension output is that I can script it further to generate CSS like above.
There are many other tricks this command can do, just type ‘man feh’ to learn more.
By the way, I’ve started using gThumb as my default image viewer, it’s still lightweight and quite powerful. It’s essentially the same as eog with some minor differences and a few major enhancements
sudo apt-get install gthumb