Play Video
1
How To Open Program Files From Command Prompt
How To Open Program Files From Command Prompt
::2013/01/11::
Play Video
2
Command Prompt Basics-Moving Files and Folders in CMD [Tutorial 2]
Command Prompt Basics-Moving Files and Folders in CMD [Tutorial 2]
::2011/07/23::
Play Video
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
::2011/07/29::
Play Video
4
Command Prompt Basics 1 - Introduction (Files & Directories)
Command Prompt Basics 1 - Introduction (Files & Directories)
::2008/03/04::
Play Video
5
BASH Shell commands file ( commands for linux )
BASH Shell commands file ( commands for linux )
::2012/02/26::
Play Video
6
Retrieving currupted files from usb using cmd (command prompt)
Retrieving currupted files from usb using cmd (command prompt)
::2013/01/22::
Play Video
7
Command Prompt Basics 2 - File Manipulation
Command Prompt Basics 2 - File Manipulation
::2008/03/04::
Play Video
8
FTP Commands To Transfer Files
FTP Commands To Transfer Files
::2013/01/14::
Play Video
9
How to delete a folder through CMD (Command Prompt)
How to delete a folder through CMD (Command Prompt)
::2012/02/03::
Play Video
10
How to Delete Folder from Command Prompt in Windows 7
How to Delete Folder from Command Prompt in Windows 7
::2013/01/28::
Play Video
11
How To Compile And Run A Java Source File With Javac On Command Prompt (cmd)
How To Compile And Run A Java Source File With Javac On Command Prompt (cmd)
::2012/06/30::
Play Video
12
Command Prompt Basics - Create and Edit txt files in CMD [Tutorial 4]
Command Prompt Basics - Create and Edit txt files in CMD [Tutorial 4]
::2011/07/23::
Play Video
13
Java Is Not Recognized As An Internal Or External Command - (Easy Fix)
Java Is Not Recognized As An Internal Or External Command - (Easy Fix)
::2010/10/06::
Play Video
14
Command Prompt Basics-Moving Files and Folders in CMD tutorial
Command Prompt Basics-Moving Files and Folders in CMD tutorial
::2013/01/06::
Play Video
15
Linux Commands 101 : Tar / GZ  File Compression & Archive
Linux Commands 101 : Tar / GZ File Compression & Archive
::2012/12/15::
Play Video
16
Command Line Basics #7 - Modifying File Permissions
Command Line Basics #7 - Modifying File Permissions
::2014/04/18::
Play Video
17
Linux tar command tutorial
Linux tar command tutorial
::2010/03/06::
Play Video
18
Command Line Basics #6 - Understanding File Permissions
Command Line Basics #6 - Understanding File Permissions
::2014/04/18::
Play Video
19
FTP command , Simple  upload / download file
FTP command , Simple upload / download file
::2012/12/13::
Play Video
20
Linux Commands for Beginners: 28 - The File Command (And Easter Eggs)
Linux Commands for Beginners: 28 - The File Command (And Easter Eggs)
::2013/09/02::
Play Video
21
Command Prompt Basics-Open files in CMD [Tutorial 3]
Command Prompt Basics-Open files in CMD [Tutorial 3]
::2011/07/23::
Play Video
22
Unix Commands - 03 - Working with WC command and FILE command
Unix Commands - 03 - Working with WC command and FILE command
::2013/05/02::
Play Video
23
Deleting undeletable file through command prompt
Deleting undeletable file through command prompt
::2011/07/09::
Play Video
24
How to make jar file or manifest file using command prompt/command-line in java
How to make jar file or manifest file using command prompt/command-line in java
::2013/02/10::
Play Video
25
Deleting log files using Command Prompt
Deleting log files using Command Prompt
::2012/10/20::
Play Video
26
Visual Basic 2010 - Open External Files Through a Command Button
Visual Basic 2010 - Open External Files Through a Command Button
::2010/10/23::
Play Video
27
How To See Hidden Files Using Command Prompt
How To See Hidden Files Using Command Prompt
::2010/12/05::
Play Video
28
How to delete a file with batch file (Command line)
How to delete a file with batch file (Command line)
::2013/07/03::
Play Video
29
Command prompt batch file examples
Command prompt batch file examples
::2013/02/18::
Play Video
30
How To Delete Virus or Unwanted File Manually (using Command Prompt)
How To Delete Virus or Unwanted File Manually (using Command Prompt)
::2009/12/21::
Play Video
31
Command Prompt Basics 3 - File, Internet & Useful Commands
Command Prompt Basics 3 - File, Internet & Useful Commands
::2008/03/04::
Play Video
32
How To Use find Command In Linux Or Ubuntu to Find Files Using File-Name Step By Step Tutorial
How To Use find Command In Linux Or Ubuntu to Find Files Using File-Name Step By Step Tutorial
::2011/08/16::
Play Video
33
How To Use The Tracert Command In A Batch File © 2012
How To Use The Tracert Command In A Batch File © 2012
::2012/04/30::
Play Video
34
Batch File Tutorial, Episode Three: The GOTO Command
Batch File Tutorial, Episode Three: The GOTO Command
::2011/04/11::
Play Video
35
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
::2011/08/29::
Play Video
36
[How to]Repair a Corrupted Flash Drive using CMD (Command Prompt)
[How to]Repair a Corrupted Flash Drive using CMD (Command Prompt)
::2011/02/26::
Play Video
37
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
::2010/07/16::
Play Video
38
Rename file extensions with REN CMD Command
Rename file extensions with REN CMD Command
::2014/01/31::
Play Video
39
Creating a Batch File for the DSADD Command
Creating a Batch File for the DSADD Command
::2011/12/04::
Play Video
40
How To Hide & Unhide A Folder Using "CMD" (Command Prompt)
How To Hide & Unhide A Folder Using "CMD" (Command Prompt)
::2012/06/19::
Play Video
41
How to Use Delete Command in Unix
How to Use Delete Command in Unix
::2013/06/13::
Play Video
42
set or clear windows file attributes from command prompt by the cmd command
set or clear windows file attributes from command prompt by the cmd command 'attrib'
::2012/05/17::
Play Video
43
linux basics - rename file and moving files across directories - mv command
linux basics - rename file and moving files across directories - mv command
::2014/02/10::
Play Video
44
UNIX-1.7 Find Command (Video Tutorial)
UNIX-1.7 Find Command (Video Tutorial)
::2012/06/10::
Play Video
45
How to Use Unix Copy Command
How to Use Unix Copy Command
::2013/06/13::
Play Video
46
Linux Tutorial: The Power of the Linux Find Command
Linux Tutorial: The Power of the Linux Find Command
::2009/07/14::
Play Video
47
File Extensions and Content (Using the file Command)
File Extensions and Content (Using the file Command)
::2013/05/28::
Play Video
48
How to bulk copy files from folder using DOS command
How to bulk copy files from folder using DOS command
::2012/03/09::
Play Video
49
Command - Split File
Command - Split File
::2011/06/27::
Play Video
50
Fix Java is not recognized as an internal or external command for Minecraft Servers 1080P HD!
Fix Java is not recognized as an internal or external command for Minecraft Servers 1080P HD!
::2011/06/26::
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
Operating system Unix, Unix-like
Type file type detector

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, its status undetermined, or its type undetermined, file will indicate that the file was processed and 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 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

Other Unix and Unix-like operating systems may add extra options than these.

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 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;[3][4] file is implemented using that library.[5][6]

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. ^ libmagic(3) – Linux Library Functions Manual
  4. ^ libmagic(3) – NetBSD Library Functions Manual
  5. ^ Zoulas, Christos (February 27, 2003). "file-3.41 is now available". File mailing list. http://mx.gw.com/pipermail/file/2003/000034.html. Retrieved January 1, 2013.
  6. ^ Zoulas, Christos (March 24, 2003). "file-4.00 is now available". File mailing list. http://mx.gw.com/pipermail/file/2003/000043.html. Retrieved January 1, 2013.

External links[edit]

Manual pages[edit]

Other[edit]

Wikipedia content is licensed under the GFDL License

Mashpedia enables any individual or company to promote their own Youtube-hosted videos or Youtube Channels, offering a simple and effective plan to get them in front of our engaged audience.

Want to learn more? Please contact us at: hello@mashpedia.com

Powered by YouTube
LEGAL
  • Mashpedia © 2014