Concept

File (command)

Summary
The file command is a standard program of Unix and Unix-like operating systems for recognizing the type of data contained in a . The original version of file originated in Unix Research Version 4 in 1973. System V brought a major update with several important changes, most notably moving the file type information into an external text file rather than compiling it into the binary itself. Most major BSD and Linux distributions use a free, open-source reimplementation which was written in 1986–87 by Ian Darwin from scratch. It was expanded by Geoff Collyer in 1989 and since then has had input from many others, including Guy Harris, Chris Lowth and Eric Fischer; from late 1993 onward its maintenance has been organized by Christos Zoulas. The OpenBSD system has its own subset implementation written from scratch, but still uses the Darwin/Zoulas collection of magic file formatted information. The command has also been ported to the IBM i operating system. The Single UNIX Specification (SUS) specifies that a series of tests are performed on the file specified on the command line: if the file cannot be read, or its is undetermined, the file program will indicate that the file was processed but its type was undetermined. file must be able to determine the types directory, FIFO, socket, block , and character special file zero-length files are identified as such an initial part of file is considered and file is to use position-sensitive tests the entire file is considered and file is to use context-sensitive tests the file is identified as a data file file's position-sensitive tests are normally implemented by matching various locations within the file against a textual database of magic numbers (see the Usage section). This differs from other simpler methods such as s and schemes like MIME. In most implementations, the file command uses a database to drive the probing of the lead bytes. That database is implemented in a file called magic, whose location is usually in /etc/magic, /usr/share/file/magic or a similar location.
About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.