Sunday, January 3, 2010

Lesson 06 Determining File Content Part 04

Determining File Content

Files can contain many different types of data. The contents of any given file might be ASCII or binary.

ASCII files include, but are not limited to, these types:

Plain text
Executable shell scripts

C program source code
Mailbox-format text

Binary files include, but are not limited to, these types:

Compiled executables

Compressed data


Sound samples

It’s a good idea to check the file type before opening it, to determine the appropriate command or application to use. Binary file types use an extended character set. Some of these characters are also used to display special characters, sound an error beep at the terminal, clear or flash the screen, or even lock up the terminal display. To check the file type, use the file command.

This is the syntax for the file command:

file [options]

file type

The file command prints its best guess of the type of data contained in a file whose name is given as an argument. It bases its guess on a comparison of the contents of the file with the patterns and offsets in its reference file, /usr/share/magic.

Here are some file types, as reported by the file command:

file types table


Home | About | Link | Link
Simple Proff Blogger Template Created By Herro | Inspiring By Busy Bee Woo Themes