How can I use the `identify` command to find out *only* the file type?

Solution 1:

You can use the %m percent escape to get just the file magic:

identify -quiet -format '%m\n' 'Sample File.gif'