O'Reilly logo

A Practical Guide to Red Hat® Linux® 8 by Mark G. Sobell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

file

Displays the classification of a file

file [option] file-list

The file utility classifies files according to their contents.

Arguments

The file-list contains the pathnames of one or more files that file classifies. You can specify any kind of file, including ordinary, directory, and special files, in the file-list.

Option

-f file

file Takes the names of files to be examined from file rather than from the command line. The names of the files must be listed one per line in file.

-z

zip Attempts to classify files within a compressed file.

Notes

The file utility can classify more than 5000 file types. Some of the more common file types found on GNU/Linux systems, as displayed by file, are

 archive ascii text c program text commands text ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required