File (command)
Standard Unix program
Nº Q181820 ★★★
Rare · Literature
File (command)
Standard Unix program
file is a shell command for reporting the type of data contained in a file. It is commonly supported in Unix and Unix-like operating systems. As the command uses relatively quick-running heuristics to determine file type, it can report misleading information.
Last price
—
Floor price
—
7-day median
—
30-day sales
0
30-day range
—
In circulation
0
Price history
median
low – high
sales
No sales in this period
Show table
| Date | median | Low | High | sales |
|---|
Sales history
- Last sale
- —
- 30-day average
- —
- 30-day low
- —
- 30-day high
- —
- Sales 7d
- 0
- Sales 30d
- 0
No sales yet.
Anonymous sales: no buyer or seller shown. Figures count player-to-player sales only.
From Wikipedia
file is a shell command for reporting the type of data contained in a file. It is commonly supported in Unix and Unix-like operating systems. As the command uses relatively quick-running heuristics to determine file type, it can report misleading information. The command can be fooled, for example, by including a magic number in the content even if the rest of the content does not match what the magic number indicates. The command report cannot be taken as completely trustworthy. The Single UNIX Specification (SUS) requires the command to exhibit the following behavior with respect to the file specified via the command-line: If the file cannot be read, or its Unix file type is undetermined, the command will report that the file was processed but its type was undetermined The command must be able to determine the types directory, FIFO, socket, block special file, and character special file A zero-length file is reported as such An initial part of file is considered and the command is to use position-sensitive tests The entire file is considered and the command is to use context-sensitive tests Otherwise, the file is reported as a data file 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 file extensions and schemes like MIME. In the System V implementation, the Ian Darwin implementation, and the OpenBSD implementation, the command uses a database to drive the probing of the lead bytes. That database is stored as a file that is located in /etc/magic, /usr/share/file/magic or similar.
Text: Wikipédia, CC BY-SA 4.0. · Image: VectorVoyager (CC BY-SA 4.0) ·