In the Linux world, there's a handy tool called file for identifying file types. It can tell you about various known file types, such as text files, executable files, compressed files, files with special permissions, and a wide array of other types. It doesn't rely on file extensions but instead analyzes the actual file data to make educated guesses about its format, encoding, and purpose. The file command is particularly useful when dealing with files lacking recognizable file extensions or when you want to verify a file's type.
When you execute the file command followed by the path to a file, it provides you with information about the file's type, including its format, encoding, and other relevant details.
Example:$ file smiley.jpg ←Check what type of file "smiley.jpg" is smiley.jpg: JPEG image data, JFIF standard 1.01 ←JPEG image file $ file /etc/passwd ←Check what type of file "/etc/passwd" is /etc/passwd: ASCII text ←ASCII text file |
For more examples and usage details, please refer to the provided link.