The file command on Linux and Unix-like operating systems attempts to determine what type of file format is being used by a particular file.
file is accompanied by libmagic, which allows developers to add file guessing functionality to their software.