1
BASH Shell commands file ( commands for linux )
BASH Shell commands file ( commands for linux )
DATE: 2012/02/26::
2
How To Delete File With Command Prompt (Windows 7|8)
How To Delete File With Command Prompt (Windows 7|8)
DATE: 2014/05/03::
3
Tutorial on how to make a Java JAR file with the command prompt
Tutorial on how to make a Java JAR file with the command prompt
DATE: 2011/07/29::
4
Linux Commands for Beginners: 01 - The Linux File System
Linux Commands for Beginners: 01 - The Linux File System
DATE: 2013/03/18::
5
how to open any file on your laptop using command prompt
how to open any file on your laptop using command prompt
DATE: 2013/12/07::
6
Copy Files and Folders Faster using Command Prompt
Copy Files and Folders Faster using Command Prompt
DATE: 2012/05/22::
7
Command - Split File
Command - Split File
DATE: 2011/06/27::
8
Java Is Not Recognized As An Internal Or External Command - (Easy Fix)
Java Is Not Recognized As An Internal Or External Command - (Easy Fix)
DATE: 2010/10/05::
9
Linux tar command tutorial
Linux tar command tutorial
DATE: 2010/03/05::
10
Linux Command Line - Directories and Files
Linux Command Line - Directories and Files
DATE: 2014/07/28::
11
How To See Hidden Files Using Command Prompt
How To See Hidden Files Using Command Prompt
DATE: 2010/12/05::
12
Command Prompt Basics-Moving Files and Folders in CMD [Tutorial 2]
Command Prompt Basics-Moving Files and Folders in CMD [Tutorial 2]
DATE: 2011/07/22::
13
Creating and Writing text file in Command Prompt
Creating and Writing text file in Command Prompt
DATE: 2013/02/01::
14
Command Prompt Basics 1 - Introduction (Files & Directories)
Command Prompt Basics 1 - Introduction (Files & Directories)
DATE: 2008/03/03::
15
C++ Multiple File Command Line Build
C++ Multiple File Command Line Build
DATE: 2015/02/03::
16
Retrieving currupted files from usb using cmd (com
Retrieving currupted files from usb using cmd (com
DATE: 2013/01/22::
17
How to Rename the File using command prompt
How to Rename the File using command prompt
DATE: 2014/09/15::
18
Windows command prompt tutorial 2 - making folders, deleting folders, creating and deleting files
Windows command prompt tutorial 2 - making folders, deleting folders, creating and deleting files
DATE: 2013/12/19::
19
How to file transfer (SFTP) with command prompt
How to file transfer (SFTP) with command prompt
DATE: 2010/03/15::
20
How to create files & Folders Using the Command Line in Windows!
How to create files & Folders Using the Command Line in Windows!
DATE: 2012/03/18::
21
Command prompt batch file examples
Command prompt batch file examples
DATE: 2013/02/17::
22
How To Use cp Command To copy files and folders In Linux Or Ubuntu Step By Step Tutorial
How To Use cp Command To copy files and folders In Linux Or Ubuntu Step By Step Tutorial
DATE: 2011/08/29::
23
How to change the owner of any file / directory using CHOWN command in Unix / Linux ?
How to change the owner of any file / directory using CHOWN command in Unix / Linux ?
DATE: 2014/10/28::
24
Delete Files Using the Windows XP Command Prompt
Delete Files Using the Windows XP Command Prompt
DATE: 2009/12/18::
25
Change Multiple File Extensions in Command Prompt
Change Multiple File Extensions in Command Prompt
DATE: 2014/11/04::
26
FTP command , Simple  upload / download file
FTP command , Simple upload / download file
DATE: 2012/12/13::
27
Command Line Crash Course - Ex 12 - View a File (less, more)
Command Line Crash Course - Ex 12 - View a File (less, more)
DATE: 2014/03/07::
28
Unix Commands - 03 - Working with WC command and FILE command
Unix Commands - 03 - Working with WC command and FILE command
DATE: 2013/05/02::
29
Security Tip : How To Hide Files/Folders Using Command Prompt
Security Tip : How To Hide Files/Folders Using Command Prompt
DATE: 2011/11/12::
30
Change File Extensions Using Command Window
Change File Extensions Using Command Window
DATE: 2013/12/30::
31
Informatica -- FTP File using Command Task
Informatica -- FTP File using Command Task
DATE: 2014/05/11::
32
Visual Basic 2010 - Open External Files Through a Command Button
Visual Basic 2010 - Open External Files Through a Command Button
DATE: 2010/10/23::
33
Introduction to the Linker Command File
Introduction to the Linker Command File
DATE: 2014/10/24::
34
UNIX-1.7 Find Command (Video Tutorial)
UNIX-1.7 Find Command (Video Tutorial)
DATE: 2012/06/09::
35
linux basics - rename file and moving files across directories - mv command
linux basics - rename file and moving files across directories - mv command
DATE: 2014/02/10::
36
How To Delete Virus or Unwanted File Manually (using Command Prompt)
How To Delete Virus or Unwanted File Manually (using Command Prompt)
DATE: 2009/12/21::
37
How to create a file with MS-DOS Copy Con Command
How to create a file with MS-DOS Copy Con Command
DATE: 2012/10/30::
38
How to run java program in command prompt
How to run java program in command prompt
DATE: 2013/02/10::
39
how to crack password of winrar file using command prompt
how to crack password of winrar file using command prompt
DATE: 2015/01/30::
40
How to delete a folder through CMD (Command Prompt)
How to delete a folder through CMD (Command Prompt)
DATE: 2012/02/03::
41
executing batch file in the command-line in windows and concatenating file to standard output
executing batch file in the command-line in windows and concatenating file to standard output
DATE: 2010/07/16::
42
Linux Commands for Beginners: 28 - The File Command (And Easter Eggs)
Linux Commands for Beginners: 28 - The File Command (And Easter Eggs)
DATE: 2013/09/01::
43
How To Use mv Command To move files and folders In Linux Or Ubuntu Step By Step Tutorial
How To Use mv Command To move files and folders In Linux Or Ubuntu Step By Step Tutorial
DATE: 2011/08/29::
44
How to make a  .C file into  .exe file using command prompt
How to make a .C file into .exe file using command prompt
DATE: 2014/05/27::
45
Batch File Tutorial, Episode Three: The GOTO Command
Batch File Tutorial, Episode Three: The GOTO Command
DATE: 2011/04/11::
46
How to save Command Prompt (CMD) output to a text file ? ITStudentsarena
How to save Command Prompt (CMD) output to a text file ? ITStudentsarena
DATE: 2014/12/11::
47
How to delete a file with batch file (Command line)
How to delete a file with batch file (Command line)
DATE: 2013/07/03::
48
Manipulating File using Command Line in Linux Mint (Ubuntu)
Manipulating File using Command Line in Linux Mint (Ubuntu)
DATE: 2013/04/28::
49
How to install sql server 2012 from command line using configuration file
How to install sql server 2012 from command line using configuration file
DATE: 2015/02/10::
50
Linux Tutorial: The Power of the Linux Find Command
Linux Tutorial: The Power of the Linux Find Command
DATE: 2009/07/14::
NEXT >>
RESULTS [51 .. 101]
From Wikipedia, the free encyclopedia
Jump to: navigation, search
File (command)
Initial release 1973 (1973) as part of Unix Research Version 4; 1986 (1986) open-source reimplementation
Written in C
Operating system Unix, Unix-like, Cross-platform
Type file type detector
License BSD license
Website darwinsys.com/file/

file is a standard Unix program for recognizing the type of data contained in a computer file.

History[edit]

The original version of file originated in Unix Research Version 4[1] in 1973. System V brought a major update with several important changes, most notably moving the file type information into an external text file rather than compiling it into the binary itself.

All major BSD and Linux distributions use a free, open-source reimplementation which was written in 1986-87 by Ian Darwin[2] from scratch. It was expanded by Geoff Collyer in 1989 and since then has had input from many others, including Guy Harris, Chris Lowth and Eric Fischer; from late 1993 onward its maintenance has been organized by Christos Zoulas.

Specification[edit]

The Single Unix Specification (SUS) specifies that a series of tests are performed on the file specified on the command line:

  1. if the file cannot be read, or its Unix file type is undetermined, the file program will indicate that the file was processed but its type was undetermined.
  2. file must be able to determine the types directory, FIFO, socket, block special file, and character special file
  3. zero-length files are identified as such
  4. an initial part of file is considered and file is to use position-sensitive tests
  5. the entire file is considered and file is to use context-sensitive tests
  6. the file is identified as a data file

file's 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 most implementations, the file command uses a database to drive the probing of the lead bytes. That database is implemented in a file called magic, whose location is usually in /etc/magic, /usr/share/file/magic or a similar location.

Usage[edit]

The SUS[3] mandates the following options:

-M file, specify a file specially formatted containing position-sensitive tests; default position-sensitive tests and context-sensitive tests will not be performed.
-m file, as for -M, but default tests will be performed after the tests contained in file.
-d, perform default position-sensitive and context-sensitive tests to the given file; this is the default behaviour unless -M or -m is specified.
-h, do-not-dereference symbolic links that point to an existing file or directory.
-L, dereference the symbolic link that points to an existing file or directory.
-i, do not classify the file further than to identify it as either: nonexistent, a block special file, a character special file, a directory, a FIFO, a socket, a symbolic link, or a regular file. Linux[4] and BSD[5] systems behave differently with this option and instead output an Internet media type (“MIME type”) identifying the recognized file format.

Other Unix and Unix-like operating systems may add extra options than these, such as -s 'special files' (examples below).

The command tells only what the file looks like, not what it is (in the case where file looks at the content). It is easy to fool the program by putting a magic number into a file the content of which does not match it. Thus the command is not usable as a security tool other than in specific situations.

Examples[edit]

$ file file.c
file.c: C program text
$ file program
program: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked
    (uses shared libs), stripped
$ file /dev/wd0a
/dev/wd0a: block special (0/0)
$ file -s /dev/hda1
/dev/hda1: Linux/i386 ext2 filesystem
$ file -s /dev/hda5
/dev/hda5: Linux/i386 swap file
$ file compressed.gz
compressed.gz: gzip compressed data, deflated, original filename, `compressed', last
    modified: Thu Jan 26 14:08:23 2006, os: Unix
$ file -i compressed.gz    # (on Linux)
compressed.gz: application/x-gzip; charset=binary
$ file data.ppm
data.ppm: Netpbm PPM "rawbits" image data
$ file /Applications/Safari.app/Contents/MacOS/Safari 
/Applications/Safari.app/Contents/MacOS/Safari: Mach-O universal binary with 2 architectures
/Applications/Safari.app/Contents/MacOS/Safari (for architecture ppc7400):    Mach-O executable ppc
/Applications/Safari.app/Contents/MacOS/Safari (for architecture i386): Mach-O executable i386

Libmagic library[edit]

As of version 4.00 of the Ian Darwin/Christos Zoulas version of file, the functionality of file is incorporated into a libmagic library that is accessible via C (and C-compatible) linking;[6][7] file is implemented using that library.[8][9]

References[edit]

  1. ^ See [1] this copy of the UNIX V4 man page
  2. ^ The history of this program is recorded in its private CVS repository; see [2] the log of the main program
  3. ^ The Open Group Base Specifications Issue 7 — file command
  4. ^ file(1) – Linux Programmer's Manual – User Commands
  5. ^ file(1) – NetBSD General Commands Manual
  6. ^ libmagic(3) – Linux Programmer's Manual – Library Functions
  7. ^ libmagic(3) – NetBSD Library Functions Manual
  8. ^ Zoulas, Christos (February 27, 2003). "file-3.41 is now available". File (Mailing list). Retrieved January 1, 2013. 
  9. ^ Zoulas, Christos (March 24, 2003). "file-4.00 is now available". File (Mailing list). Retrieved January 1, 2013. 

External links[edit]

Manual pages[edit]

Other[edit]

Wikipedia content is licensed under the GFDL License
Powered by YouTube
MASHPEDIA
LEGAL
  • Mashpedia © 2015