010-150 · Question #78
Which is a suitable command to find the next appearance of the word hidden in a man page being viewed from the command line?
The correct answer is D. /hidden. Man pages are displayed through the 'less' pager, which uses vi-style search syntax where a forward slash followed by a term searches forward through the document.
Question
Which is a suitable command to find the next appearance of the word hidden in a man page being viewed from the command line?
Options
- Afind hidden
- B/? hidden
- CCTRL-F hidden
- D/hidden
How the community answered
(57 responses)- A14% (8)
- B5% (3)
- C4% (2)
- D77% (44)
Why each option
Man pages are displayed through the 'less' pager, which uses vi-style search syntax where a forward slash followed by a term searches forward through the document.
'find' is a standalone shell utility for locating files in a directory tree and has no function inside a man page viewer.
'/?' is not valid search syntax in less - the '?' character on its own initiates a backward search, but '/?' combined is not a recognized command.
Ctrl-F in less is bound to scroll forward by one full page (equivalent to Page Down), not to open a text search prompt.
Typing /hidden in less (the default man page pager) initiates a forward incremental search for the string 'hidden', highlighting the next occurrence. Pressing 'n' repeats the search forward and 'N' repeats it backward, which is the standard vi/less navigation model used in virtually all Linux man page viewers.
Concept tested: Forward text search inside less/man pager
Source: https://man7.org/linux/man-pages/man1/less.1.html
Topics
Community Discussion
5D is the one, and this is a question that catches people every time because the distractors are really well designed. In a man page you are inside the less pager by default, and the way you search forward through less is exactly the same as you search in vi, which is just a forward slash followed immediately by your search term, so /hidden and then hit Enter. The CTRL-F option in C is wrong because that is the less keybinding for paging forward one full screen, not for searching. Option A is just made-up syntax that does nothing, and B flips the slash the wrong way around which would search backward if you used a real question mark in less, not forward. Get this one locked in early because the man page navigation commands show up in multiple objectives on the 010-150.
Does typing /hidden feel like a search or more like a filter to you?
It starts feeling like a search the first few times you use it, but once you trust the pattern it shifts into filter territory, which is actually the more useful mental model for narrowing down what you need under pressure.
D is the one you want. When you are in a man page the pager running underneath is usually less, and in less you type a forward slash followed immediately by your search term to jump to the next match, so /hidden drops you right there.
The wording "next appearance" is doing quiet work here, because it assumes you already know how to open a search in the first place. In a man page you are inside less or a similar pager, and the forward-search command is the forward slash, so typing /hidden and pressing Enter drops your cursor on the first match ahead of your current position, and pressing n from there keeps stepping forward. Option C is the big distractor because Ctrl-F is exactly what your muscle memory wants to reach for from a browser or a GUI text editor, but in a terminal pager Ctrl-F is page-down, it has nothing to do with search. The other two options, find and /? hidden, simply do not exist as pager commands in any standard form. Land on D.