File command
From RZWiki
A CLI command available on most Linux platforms; used to determine and display the type of one or more files.
Contents |
Usage Syntax
file [options]
Common options include;
- -f file_name - read the names of the files to be examined from the specified file (this option must be used before others)
- -b - display only brief information (don't display file name(s))
- -h - don't follow symbolic links (default behaviour on most systems)
- -L - follow symbolic links
- -i - display MIME type strings rather than human readable ones
- -p - attempt to preserve the access time of the file(s) analysed
- -z - attempt to look inside compressed files
Usage Examples
Usage Notes
Linux Usage Notes
With most Linux or Unix commands;
- Non root users may need to prefix commands with the sudo command, for example: sudo chmod 644 *
- Brief help can be displayed using the -h or --help parameter, for example: chmod --help
- A full command manual can be displayed using the man command followed by the command name, for example: man chmod
- Sometimes 'info' pages are used instead of or to provide more information than man pages; for example: info chmod
- Version information can normally be display using the -v, -V or --version parameter, for example: chmod --version. However, this paramater is also frequently used to display verbose output.
noinclude/noinclude
Typical Output
noinclude/noinclude
file test.txt;
test.txt: ASCII text
file test.zip;
test.zip: Zip archive data, at least v2.0 to extract
file mysqltuner.pl;
mysqltuner.pl: perl script text executable
file applications-internet.png;
applications-internet.png: PNG image data, 16 x 16, 8-bit/color RGBA, non-interlaced
Related Files
The file executable is normally found here: /usr/bin/file
Related Articles
Information on other Linux commands
Information on F5 BigIP commands
Information on Cisco commands
Information on Vyatta commands
Information on Extreme commands
Information on Nortel commands
Information on Zebra commands
Information on Windows commands
Information on Secure Platform commands
Information on Blue Coat SGOS commands
Information on Nokia IPSO commands
(replacing the # with an @) |






