File is the open source and free implementation of the ‘file’ command used on almost every UNIX-like operating system, such as Linux and BSD. The ‘file’ command, if you’re not familiar with it, is a command-line program that tells you what kind of data a file contains.

The original ‘file’ command shipped with Bell Labs UNIX, but was unavailable in source form to the masses before this re-implementation. Like any other command-line program, File must be used through any terminal emulator application.

Command-line options

File comes with various command-line options that will help you to classify files on your GNU/Linux system better and faster. They can be viewed at a glance by running the ‘file –help’ command in a terminal emulator app.

Among the most useful command-line options, we can mention support for using a specific file as a color-separated list of magic number files, support for processing compressed files, as well as support for outputting MIME type strings, MIME encoding or Apple type/creator.

Additionally, the user will be able to list magic strength, to enable following of symlinks, to terminate filenames with ASCII NUL, to preserve access time on files, to treat special files as ordinary ones, and to compile a file that is specified by the -m (–magic-file LIST) option.

Under the hood and supported OSes

File is a cross-platform software written entirely in the C programming language, which means that it is fast and supports all known GNU/Linux operating systems, as well as various BSD distributions, including FreeBSD, OpenBSD and NetBSD. Darwin/Mac OS X is also supported.

The program is distributed as a universal source tarball (TAR archive) that can be easily installed on any 32-bit or 64-bit system. To install it, simply download the archive, save it on your PC, unpack it, open a terminal app and navigate to the location of the extracted archive files (e.g. cd /home/softpedia/file-5.20), run the ‘./configure && make’ command, and then execute the ‘make install’ or ‘sudo make install’ command.