Determine file type in Linux or Mac OS X

To determine the file type in Linux, we can use the file command. This command runs three sets of tests: the filesystem test, magic number test, and language test. The first test that succeeds causes the file type to be printed. For example, if a file is a text file, it will be recognized as ASCII text.

Here are a couple of examples:

Leave a Reply

Your email address will not be published. Required fields are marked *