LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 07-30-2007, 03:42 AM   #1
OldAl
Member
 
Registered: Oct 2006
Location: Canberra, Australia
Distribution: Kubuntu "Feisty",openSUSE10.3
Posts: 93

Rep: Reputation: 15
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 .

Last edited by OldAl; 07-30-2007 at 03:50 AM.
 
Old 07-30-2007, 03:55 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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.

Last edited by Nylex; 07-30-2007 at 04:04 AM.
 
Old 07-31-2007, 02:03 AM   #3
OldAl
Member
 
Registered: Oct 2006
Location: Canberra, Australia
Distribution: Kubuntu "Feisty",openSUSE10.3
Posts: 93

Original Poster
Rep: Reputation: 15
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.
 
Old 07-31-2007, 02:11 AM   #4
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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.
 
Old 07-31-2007, 02:31 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
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.
 
Old 08-02-2007, 12:58 AM   #6
OldAl
Member
 
Registered: Oct 2006
Location: Canberra, Australia
Distribution: Kubuntu "Feisty",openSUSE10.3
Posts: 93

Original Poster
Rep: Reputation: 15
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!
 
Old 08-02-2007, 01:04 AM   #7
OldAl
Member
 
Registered: Oct 2006
Location: Canberra, Australia
Distribution: Kubuntu "Feisty",openSUSE10.3
Posts: 93

Original Poster
Rep: Reputation: 15
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,
 
Old 08-02-2007, 10:26 PM   #8
krazytekn0
LQ Newbie
 
Registered: Mar 2007
Posts: 21

Rep: Reputation: 15
....

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
 
Old 08-03-2007, 01:48 AM   #9
OldAl
Member
 
Registered: Oct 2006
Location: Canberra, Australia
Distribution: Kubuntu "Feisty",openSUSE10.3
Posts: 93

Original Poster
Rep: Reputation: 15
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,
 
Old 08-03-2007, 02:08 AM   #10
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
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.

Last edited by theYinYeti; 08-03-2007 at 02:13 AM.
 
Old 08-03-2007, 06:57 AM   #11
OldAl
Member
 
Registered: Oct 2006
Location: Canberra, Australia
Distribution: Kubuntu "Feisty",openSUSE10.3
Posts: 93

Original Poster
Rep: Reputation: 15
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.
 
Old 08-03-2007, 10:38 AM   #12
krazytekn0
LQ Newbie
 
Registered: Mar 2007
Posts: 21

Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between "man" and "info" gexecuter Linux - Newbie 17 09-26-2007 03:17 PM
"list dynamic dependency" of an executable using command other than "ldd" Amrita@3086 Solaris / OpenSolaris 3 04-04-2007 04:56 AM
grub list "MZ" for my windows boot "Help on Change" davimint Linux - Newbie 2 01-26-2006 06:22 AM
User "list" running process "python" TroelsSmit Linux - Newbie 2 02-22-2005 04:55 AM
man pages show backquotes as "u" with umlaut? brainclots Red Hat 1 12-01-2003 11:26 PM


All times are GMT -5. The time now is 10:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration