Determining file type: file

The file command examines the content of a file and reports what type of file it is.

To use the command enter:

   file filename

Use this command to check the identity of a file, or to find out if executable files contain shell scripts, or are binaries. Shell scripts are text files and can be displayed and edited.

Examples

To check the identity of a single file:

   file ReportA
   ReportA:        Frame Maker document

This checks the identity of the file ReportA and reports that this file has been created using the Frame Maker application.

To check the identity of several files:

   file *
   external.c:     c program text
   external.h:     c program text
   mc:             sparc demand paged dynamically linked executable
   mcXThelp:       executable shell script
   mcdemo:         executable shell script
   mchelp:         executable shell script
   mchome:         executable shell script
   mctools:        executable shell script

This checks the identity of every file in the current directory. Notice how it reports whether a file is an executable binary or a shell script.