Qdate' A eight-byte value interpreted as a UNIX date. The string is not NUL terminated.ĭate' A four-byte value interpreted as a UNIX date. Pstring' A Pascal-style string where the first byte is interpreted as the unsigned length. Finally the ''c'' flag, specifies case insensitive matching: lowercase characters in the magic matchīoth lower and upper case characters in the target, whereas upper case characters in the magic only match uppercase characters in the target. Treats every blank in the target as an optional blank. If the magic has n consecutive blanks, the target needs at least n consecutive blanks to match. The ''B'' flag compacts whitespace in the target, which mustĬontain at least one whitespace character.
The string type specification can be optionally followed by /*. Quad' An eight-byte value in this machine's native byte order.įloat' A 32-bit single precision IEEE floating point number in this machine's native byte order.ĭouble' A 64-bit double precision IEEE floating point number in this machine's native byte order. Long' A four-byte value in this machine's native byte order. Short' A two-byte value in this machine's native byte order. Offset A number specifying the offset, in bytes, into the file of the data which is to be tested. The line consists of the following fields: If the test succeeds, a message is printed. A test compares the data starting at a particular offset in the file with a byte value, a string orĪ numeric value. The file /usr/share/misc/magic specifies what patterns are toīe tested for, what message or MIME type to print if a particular pattern is found, and additional information to extract from the file.Įach line of the file specifies a test to be performed. Using, among other tests, a test for whether the file contains certain ''magic patterns''. The file(1) command identifies the type of a file
#What are magic lines in writinmg manual
This manual page documents the format of the magic file as used by the file(1) command, version 5.04. Magic - file command's magic pattern file