While the best way to view or manipulate image files on Linux is to open them on your desktop for viewing or manipulating with tools like Gimp, there are quite a few ways to get important details on the command line.
Identifying image type by file extension
In general, image files can be identified on the command line by listing their names. Clearly “.jpg” represents a jpeg file, “.png” a portable network graphics file, “.gif” a graphics interchange format file, “.tiff” a tagged image file and so on.
$ ls -l images
-rw-rw-r–. 1 shs shs 256093 Jul 15 2018 mycats.jpg
-rw-r—–. 1 shs shs 784238 Jul 15 2018 mycats.png
-rw-rw-r–. 1 shs shs 6760 Jul 15 2018 arrow.jpg
-rw-r—–. 1 shs shs 8853 Jul 15 2018 arrow.png
Nearly all of the time you can rely on file extensions accurately reporting the file type, but there’s more you can do with additional commands.
Source:: Network World – Linux