Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Name

file

Synopsis

file [options] files

Classify the named files according to the type of data they contain. file checks the magic file (usually /usr/share/magic) to identify some file types. If the file type cannot be determined, it is shown as “data.” file does its best to identify the file type, but it is sometimes incorrect. See also the strings command to search for printable strings in nontext files.

Options

-b, --brief

Brief mode; do not prepend filenames to output lines.

-c, --checking-printout

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

-f file, --files-from file

Read the names of files to be checked from file.

-h, --no-dereference

Do not follow symbolic links. The default unless the environment variable POSIXLY_CORRECT is defined.

--help

Print help message and exit.

-i, --mime

Print mime strings rather than the traditional strings.

-L, --dereference

Follow symbolic links. By default, symbolic links are not followed.

-m file, --magic-file file

Search for file types in file instead of /usr/share/magic, where file can be either a single file or a colon-separated list of files.

--mime-type, --mime-encoding

Like -i, but print only the mime type or the mime encoding.

-n, --no-buffer

Flush standard output after checking a file.

-N, --no-pad

Do not pad filenames to align in the output.

-s, --special-files

Check files that are block or character special files in addition to checking ordinary files.

-v, --version

Print the version.

-z, --uncompress

Attempt ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page