nerdexam
CompTIA

LX0-103 · Question #101

The command used to determine a file's type is

The correct answer is C. file. The file command inspects a file's internal content and magic bytes to determine its actual type, independent of its extension.

GNU and Unix Commands

Question

The command used to determine a file's type is

Options

  • Atype
  • Bfind
  • Cfile
  • DIs

How the community answered

(37 responses)
  • A
    3% (1)
  • B
    3% (1)
  • C
    89% (33)
  • D
    5% (2)

Why each option

The `file` command inspects a file's internal content and magic bytes to determine its actual type, independent of its extension.

Atype

The `type` command is a shell built-in that identifies how a command name is interpreted by the shell (as an alias, function, or external binary), not the content type of a file.

Bfind

The `find` command searches directory hierarchies for files matching criteria such as name, size, or modification time, but does not analyze or report the internal content type of a file.

CfileCorrect

The `file` command reads a file's content, including magic numbers and structural signatures, to identify its true type (e.g., ELF binary, ASCII text, JPEG image). It is the standard Unix/Linux utility for this purpose and works regardless of the filename or extension.

DIs

`ls` (rendered here as 'Is' due to a font artifact) lists directory contents and basic file metadata such as size and permissions, but does not identify a file's internal format or content type.

Concept tested: Linux `file` command for identifying file content types

Source: https://man7.org/linux/man-pages/man1/file.1.html

Topics

#file command#file type detection

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice