内に含まその他のドキュメントサポート リソース | PDF 文書ファイルをダウンロードする (6561 KB)
file(1)Name | Synopsis | Description | Options | Operands | Usage | Examples | Environment Variables | Exit Status | Files | Attributes | See Also Name
Synopsis/usr/bin/file [-dh] [-m mfile] [-M Mfile] [-f ffile] file... /usr/bin/file [-dh] [-m mfile] [-M Mfile] -f ffile /usr/bin/file -i [-h] [-f ffile] file... /usr/bin/file -i [-h] -f ffile /usr/bin/file -c [-d] [-m mfile] [-M Mfile] /usr/xpg4/bin/file [-dh] [-m mfile] [-M Mfile] [-f ffile] file... /usr/xpg4/bin/file [-dh] [-m mfile] [-M Mfile] -f ffile /usr/xpg4/bin/file -i [-h] [-f ffile] file... /usr/xpg4/bin/file -i [-h] -f ffile /usr/xpg4/bin/file -c [-d] [-m mfile] [-M Mfile] DescriptionThe file utility performs a series of tests on each file supplied by file and, optionally, on each file listed in ffile in an attempt to classify it. If the file is not a regular file, its file type is identified. The file types directory, FIFO, block special, and character special are identified as such. If the file is a regular file and the file is zero-length, it is identified as an empty file. If file appears to be a text file, file examines the first 512 bytes and tries to determine its programming language. If file is a symbolic link, by default the link is followed and file tests the file to which the symbolic link refers. If file is a relocatable object, executable, or shared object, file prints out information regarding the file's execution requirements. This information includes the machine class, byte-ordering, static or dynamic linkage, and any software or hardware capability requirements. By default, file will try to use the localized magic file /usr/lib/locale/locale/LC_MESSAGES/magic, if it exists, to identify files that have a magic number. For example, in the Japanese locale, file will try to use /usr/lib/locale/ja/LC_MESSAGES/magic. If a localized magic file does not exist, file will utilize /etc/magic. A magic number is a numeric or string constant that indicates the file type. See magic(4) for an explanation of the format of /etc/magic. If file does not exist, cannot be read, or its file status could not be determined, it is not considered an error that affects the exit status. The output will indicate that the file was processed, but that its type could not be determined. Options
The following options are supported: If the -M option is specified with the -d option, the -m option, or both, or if the -m option is specified with the -d option, the concatenation of the position-sensitive tests specified by these options is applied in the order specified by the appearance of these options. OperandsUsageSee largefile(5) for the description of the behavior of file when encountering files greater than or equal to 2 Gbyte ( 231 bytes). ExamplesExample 1 Binary executable filesDetermine if an argument is a binary executable file:
Environment VariablesSee environ(5) for descriptions of the following environment variables that affect the execution of file: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. Exit StatusFilesAttributesSee attributes(5) for descriptions of the following attributes:
See AlsoSunOS 5.10 Last Revised 16 July 2004Name | Synopsis | Description | Options | Operands | Usage | Examples | Environment Variables | Exit Status | Files | Attributes | See Also |
|||||||||