nerdexam
CompTIA

LX0-103 · Question #97

Which of the following commands can be used to locate programs and their corresponding man pages and configuration files?

The correct answer is E. whereis. The whereis command searches for a program's binary, source code, and man page files, making it the correct tool for locating all three components at once.

GNU and Unix Commands

Question

Which of the following commands can be used to locate programs and their corresponding man pages and configuration files?

Options

  • Adirname
  • Bwhich
  • Cbasename
  • Dquery
  • Ewhereis

How the community answered

(52 responses)
  • A
    2% (1)
  • C
    4% (2)
  • D
    6% (3)
  • E
    88% (46)

Why each option

The whereis command searches for a program's binary, source code, and man page files, making it the correct tool for locating all three components at once.

Adirname

dirname strips the non-directory suffix from a given path string and does not search for files at all.

Bwhich

which only locates the executable binary of a command by searching directories listed in the PATH variable, not man pages or configuration files.

Cbasename

basename strips the directory prefix from a path string and does not perform any file searching.

Dquery

query is not a standard Linux utility for locating programs or their associated files.

EwhereisCorrect

whereis searches standard binary directories, man page directories, and source directories simultaneously, returning paths for the executable, its manual pages, and any configuration or source files. Unlike which, it is not limited to just the executable path. This makes it the only command in the list capable of locating programs along with their man pages and configuration files.

Concept tested: Linux whereis command for file location

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

Topics

#whereis#command location#man pages#configuration files

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice