home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: fgrep Chapter 2
UNIX Commands
Next: Reference: find
 

file



file

 [

options

] 

files

Classify the named files according to the type of data they contain. file checks the magic file (usually /etc/magic ) to identify some file types.

Options

-c

Check the format of the magic file ( files argument is invalid with -c ).

-f list

Run file on the filenames in list .

-h

Do not follow symbolic links.

-L

Test the file that is referenced by a symbolic link, rather than the link itself.

-m file

Use file as the magic file instead of /etc/magic .

Many file types are understood. Output lists each filename, followed by a brief classification such as:

ascii text
c program text
c-shell commands
data
empty
iAPX 386 executable
directory
[

nt

]roff, tbl, or eqn input text
shell commands
symbolic link to ../usr/etc/arp

Example

List all files that are deemed to be troff/nroff input:



file * | grep roff


Previous: Reference: fgrep UNIX in a Nutshell: System V Edition Next: Reference: find
Reference: fgrep Book Index Reference: find

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System