nerdexam
Linux_Foundation

LFCS · Question #701

The command used to determine a file's type is

The correct answer is C. file. The file command is used to determine the type of a file by examining its content and metadata.

Submitted by stefanr· Apr 18, 2026Essential Commands

Question

The command used to determine a file's type is

Options

  • Atype
  • Bfind
  • Cfile
  • DIs

How the community answered

(20 responses)
  • A
    5% (1)
  • C
    95% (19)

Why each option

The `file` command is used to determine the type of a file by examining its content and metadata.

Atype

`type` is a shell builtin command that indicates how the shell will interpret a command name (e.g., as an alias, function, builtin, or external command), not for determining the content type of an arbitrary file.

Bfind

`find` is used to locate files and directories within a filesystem based on various criteria like name, size, or modification date, but it does not determine the internal content type of a file.

CfileCorrect

The `file` command analyzes the content of a specified file using a database of magic numbers and heuristic tests to classify its type, such as ASCII text, ELF executable, image data, or compressed archive, providing a detailed description.

DIs

`ls` lists directory contents and displays file attributes like permissions, size, and modification dates, but it does not analyze the file's content to determine its inherent data type beyond what might be inferred from its name or permissions.

Concept tested: Determining file types

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

Topics

#file command#file type identification#Linux utilities

Community Discussion

No community discussion yet for this question.

Full LFCS Practice