Log in Go to the main page Page Discussion History Go to the file list Go to the site toolbox Bookmark and Share

File command

From RZWiki


Image:linux-logo-large.png

A CLI command available on most Linux platforms; used to determine and display the type of one or more files.

Contents

Image:Vm-power-on-medium.png 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

Image:Vm-power-on-medium.png Usage Examples

Image:accessories-text-editor-v2-medium.png Usage Notes

Image:accessories-text-editor-v2-medium.png 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

Image:utilities-terminal-medium-v2.png 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

Image:Folder-medium.png Related Files

The file executable is normally found here: /usr/bin/file

Image:icemon-medium.png Related Articles

Information on other Linux commands Image:Tux-small.png

Information on F5 BigIP commands Image:F5-logo-small.png

Information on Cisco commands Image:Cisco-logo-small.png

Information on Vyatta commands Image:Vyatta-logo-small.png

Information on Extreme commands Image:Extreme-logo-small.png

Information on Nortel commands Image:Nortel-logo-small.png

Information on Zebra commands

Information on Windows commands Image:Preferences-system-windows-small.png

Information on Secure Platform commands

Information on Blue Coat SGOS commands

Information on Nokia IPSO commands


Image:internet-group-chat-small.png We really do appreciate all feedback so please do send your comments, suggestions or corrections to sjiveson#routerzone.eu
(replacing the # with an @)


Site Toolbox:

Personal tools
This page was last modified on 4 June 2009, at 12:52. - Disclaimers - About RZWiki
Powered by MediaWiki