12

Let's say I want the man page related to luks. man luks doesn't work, is there a quick way for me to find the man pages using the keyword luks from bash ?

ChiseledAbs
  • 2,243
  • @Kusalananda The OP wants to know how to find a man page, given that you know a package name. That link isn't relevant at all. – JBentley Jul 26 '16 at 19:18
  • Flagged for moderator attention. The other link isn't relevant either. It asks how to find information in a man page, not how to find the man page in the first place. People should take more care with close votes - neither of the duplicates here are asking the same question. – JBentley Jul 26 '16 at 19:21
  • @JBentley note that the last close vote here was cast by the special "Community" user. That means that the OP accepted the duplicate and closed it themselves. In any case, it is a duplicate. Both apropos and man -K/-k are mentioned in the answers to the dupe. – terdon Jul 27 '16 at 09:07
  • @terdon That's not how the duplicate system is meant to work: "[questions] are sufficiently similar to existing questions and would be answered identically to them.", and: "The fundamental goal of closing duplicate questions is to help people find the right answer by getting all of those answers in one place". Just because someone happened to post an answer on a different question that could have been an answer to this question, does not make them duplicates. – JBentley Jul 27 '16 at 09:33
  • @terdon By closing this question, nobody can post any more answers which might be useful in this context, and the other two questions don't ask the same thing. This question is a useful one which deserves to exist in its own right, unless someone can find a duplicate which actually asks the same thing. – JBentley Jul 27 '16 at 09:35
  • @JBentley if the person who asked the question considers it a duplicate, that should be good enough for you too. Even if they hadn't, this question is an obvious subset of the first duplicate. it's not that someone "happened" to post an answer that helps, it's that it's the same basic question. And yes, we want all the answers in one place, that's precisely why this was closed as a duplicate. If you have another answer, post it to the "tips and tricks" question. If you still feel this was incorrectly closed, please take it to meta instead of flagging so the community can decide. – terdon Jul 27 '16 at 09:38

2 Answers2

16

You're looking for apropos; on my system apropos luks points me to cryptsetup(8), luksformat(8) and a number of other relevant manpages.

apropos, which is equivalent to man -k, looks in the installed manpages' names and descriptions for the search text given on its command line. The search text can include regular expressions or shell-style globs (with apropos, using the -r or -w options; -r is the default).

man -K allows searching in all the contents of all the installed manpages. This takes longer than apropos or man -k.

(Thanks to Stephen Harris and clusterdude for the extra clarification.)

Stephen Kitt
  • 434,908
  • Why is it called apropos? – 123 Jul 26 '16 at 13:44
  • 1
    apropos is an English word, roughly meaning "concerning" or "pertaining to" in this context. It's just not necessarily the word you'd first think of :-) From the French "a propos"; "on that subject" – Stephen Harris Jul 26 '16 at 13:54
10

Try using apropos, it will search in the titles / descriptions of manual pages for a certain string :

apropos luks
magor
  • 3,752
  • 2
  • 13
  • 28