LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   List tools that have "man" pages. (http://www.linuxquestions.org/questions/ubuntu-63/list-tools-that-have-man-pages-573312/)

OldAl 07-30-2007 04:42 AM

List tools that have "man" pages.
 
Hi,

"Man" pages are a handy help when one knows the name of the tool. However, in my old age I often forget the exact name of the tool. It should be possible to list all man pages and sift it trough a "grep" filter and thus find the exact name of the tool that one is trying to recall. For instance, when the partitions have been created with their file systems, reiserfstune is a handy tool that I use to set label (volume) names for the partitions with reiser FS. There is a similar tool for ext3 FS, but what is its name? I remember that it, too, has "tune" in its name. I also know that both of these tools have a "man" page.

My problem is that I do not know of a way to list in CLI names of commands which have "man" pages, so I could then filter the list trough grep.

It surely must be possible and easy. In Konqueror, an entry man:/<start of a name> shows the list of commands with man pages in a drop down list. Since it is done in GUI, it should be possible in CLI.

Actually, with Konqueror I can find the command name for ext3 files, which is "tune2fs", but I would like to know a way to search for it in CLI.

Any clues? TIA!

OldAl, Canberra in winter .

Nylex 07-30-2007 04:55 AM

Could you maybe use apropos to search for commands with a keyword, e.g. "apropos ext3" (instead of using grep I mean)? I believe the command you're looking for is tune2fs.

OldAl 07-31-2007 03:03 AM

Thank you, Nylex. Actually
Code:

apropos tune |grep fs
does exactly what I want. Generally it would be better if before answering a question the question was read more thoroughly - I've deliberately did state that the command I was looking for is tune2fs (for ext2/ext3 file systems), so that actually I was not looking for the command, but for a way of finding a command with CLI when only a part of a command is known (or recalled).

Thanks for jolting my memory, Nylex - apropos is indeed the answer.

b0uncer 07-31-2007 03:11 AM

In addition to apropos, have a try at
Code:

man -k tune |grep fs
and read
Code:

man grep
to get it tuned better.

Apropos and man -k outputs look the same to me now, but if I remember correctly, there can be cases where their outputs differ (the other shows more or less than the other). It can just be me, but I have a picture they're not 100% the same.

Nylex 07-31-2007 03:31 AM

Quote:

Originally Posted by OldAl
Generally it would be better if before answering a question the question was read more thoroughly - I've deliberately did state that the command I was looking for is tune2fs (for ext2/ext3 file systems)

That part wasn't there when I read your post the first time and I *did* read the entire thing.

OldAl 08-02-2007 01:58 AM

Well, Nylex, we are not going to argue about you reading it all in the first place. Let me just say, that I wrote it once and did not edit it afterwards, so whatever is in my post, it has been there since the first posting. May I suggest that you did not pay attention to what you read?

Anyway, your suggestion was very valuable and I gratefully acknowledge that with a big THANK YOU!

OldAl 08-02-2007 02:04 AM

Quote:

Originally Posted by b0uncer
In addition to apropos, have a try at
Code:

man -k tune |grep fs

Thank you for the great alternative to apropos. Actually, the above returns only the two commands that are applicable, so no further tuning of grep is necessary.

I learned a lot from the two replies - gratefully yours,

krazytekn0 08-02-2007 11:26 PM

....
 
I know that this is kind of a necro post since the topic is totally solved, but when I first saw this question I did '%~ man man' and found the -k switch from there

OldAl 08-03-2007 02:48 AM

Quote:

Originally Posted by krazytekn0
I know that this is kind of a necro post since the topic is totally solved, but when I first saw this question I did '%~ man man' and found the -k switch from there

Thank you for your contribution. It is always useful to know not just the answer, but how the answer was arrived at!

Kind regards,

theYinYeti 08-03-2007 03:08 AM

Here is an alternative :)

findman.sh:
Code:

#!/bin/bash

manlist="$(tr ':' '\n' <<<"$MANPATH" | grep -v '^$')"
if [ -z "$manlist" ]; then
  manlist="$(tr ':' '\n' <<<"$PATH" | sed -n 's#/bin$#/man#p; s#/man$#/share/man#p')"
fi

while read p; do
  find "$p" "$@" 2>/dev/null
done <<<"$manlist"

Use like this, using the "find" command options:
Code:

./findman.sh -iname '*ext3*'
or
./findman.sh -regex '.*/man1/.*conf.*'

Yves.

OldAl 08-03-2007 07:57 AM

Quote:

Originally Posted by theYinYeti
Here is an alternative :)

Indeed :). Nice and "simple". Its like using a Sherman tank to get the grandkids to school.

Thanks for your attention.

krazytekn0 08-03-2007 11:38 AM

Quote:

Originally Posted by OldAl
Indeed :). Nice and "simple". Its like using a Sherman tank to get the grandkids to school.

Thanks for your attention.

What should I not be doing that? My tank will miss me.


All times are GMT -5. The time now is 09:12 PM.