Which command helps locate the binary, source, and manual page locations for a given command?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command helps locate the binary, source, and manual page locations for a given command?

Explanation:
Locating all related files for a command requires a tool that searches common places for binaries, sources, and manuals. whereis does exactly that: it looks through standard directories for binaries, source code, and man pages and returns all the locations it finds for the given command. This lets you see not only where the executable lives, but also whether its source and documentation are present on the system. For example, whereis gcc might show the path to the binary, such as /usr/bin/gcc, and the manual page path like /usr/share/man/man1/gcc.1.gz, and, if source or additional related files are installed, their locations too. If a component isn’t installed, it simply won’t appear in the results. In contrast, other options serve different purposes: rpm -qd lists files from a specific package, which isn’t a general search for a command’s locations; which finds only the executable in your PATH; and man shows (or can point to) a manual page, not the binary or source locations.

Locating all related files for a command requires a tool that searches common places for binaries, sources, and manuals. whereis does exactly that: it looks through standard directories for binaries, source code, and man pages and returns all the locations it finds for the given command. This lets you see not only where the executable lives, but also whether its source and documentation are present on the system.

For example, whereis gcc might show the path to the binary, such as /usr/bin/gcc, and the manual page path like /usr/share/man/man1/gcc.1.gz, and, if source or additional related files are installed, their locations too. If a component isn’t installed, it simply won’t appear in the results.

In contrast, other options serve different purposes: rpm -qd lists files from a specific package, which isn’t a general search for a command’s locations; which finds only the executable in your PATH; and man shows (or can point to) a manual page, not the binary or source locations.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy