libmagic

Identifies file types by examining their content and magic numbers

brewmacoslinux
Try with needOr install directly
Source

About

Implementation of the file(1) command

Commands

file

Examples

Identify the type of a file$ file myfile.txt
Get detailed MIME type information$ file -i document.pdf
Check multiple files at once$ file *.jpg *.png