LFCS · Question #697
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 is used to locate the binary, source, and manual page files associated with a given command.
Question
Options
- Adirname
- Bwhich
- Cbasename
- Dquery
- Ewhereis
How the community answered
(34 responses)- A3% (1)
- B6% (2)
- D3% (1)
- E88% (30)
Why each option
The `whereis` command is used to locate the binary, source, and manual page files associated with a given command.
`dirname` is a command that outputs the directory component of a path, not for locating programs or their associated files.
`which` locates only the executable binary of a command within the user's PATH environment variable, but it does not find man pages or configuration files.
`basename` outputs the non-directory (file name) component of a path, serving an opposite function to `dirname`.
`query` is not a standard general-purpose Linux command for locating programs and their associated files; it might refer to package manager query functions (e.g., `rpm -q`), which have a different scope.
The `whereis` command is specifically designed to locate the executable binary, source code, and manual page files for a specified command by searching standard system directories. This makes it ideal for finding all related components of a program.
Concept tested: Locating program components
Source: https://man7.org/linux/man-pages/man1/whereis.1.html
Topics
Community Discussion
No community discussion yet for this question.