logo

Fine Free File Command

This is the home page for the open source implementation of the file(1) command that ships with every free operating system (OpenBSD, Linux, NetBSD, FreeBSD, etc.) and has been ported to most systems where people use free software (including OS/2, DOS, MS Windows, etc.).

What?

The file command is "a file type guesser", that is, a command-line tool that tells you in words what kind of data a file contains. Unlike most GUI systems, command-line UNIX systems - with this program leading the charge - don't rely on filename extentions to tell you the type of a file, but look at the file's actual contents. This is, of course, more reliable, but requires a bit of I/O.

The original file command shipped with Bell Labs UNIX (here is a man page from Research 4th Edition, 1973, obtained from the PDP-11 Unix Preservation Society), but was unavailable in source form to the masses before Ian's reimplementation.

This file command (and magic file) was originally written by Ian Darwin (who still contributes occasionally) and is now maintained by a group of developers lead by Christos Zoulas. Announcements of new releases are made on the "file" mailing list.

Who's using it?

  • Every known BSD distribution (FreeBSD, NetBSD, OpenBSD, Darwin/Mac OS X, etc)
  • Every known Linux distribution
  • The Apache httpd server mod_mime_magic module uses the file command's innards to make file type guessing more reliable under Apache HTTPD.

Download

The file program is included in most UNIX systems today. Should you want or need to compile it yourself, or just want to see how it works, you'll find the latest version of the file command's source code at ftp://ftp.astron.com/pub/file/.

Twenty Years Before the File

My first commit in RCS, which later migrated into a CVS repository, was in August, 1987:

revision 1.1
date: 1987/08/23 19:51:05;  author: ian;  state: Exp;
Initial revision

Bugs

Please report bugs to the bug tracker or the mailing list (see above).

Other Pages about this program