Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,801
Rep:
Taming the `man' command
I know there's a way to bypass the behavior of man where it presents the list of matching keywords and forces you to enter the section you want. I've done this by adding to /etc/bash.bashrc.local the line: "export MAN_POSIXLY_CORRECT=1". This eliminates having to specify any section number, but when you finish reading the given man page, the list of matching keywords is still displayed. (For me this works out fine as 99.999% of the time what I want is in section 1.)
Is there a way to eliminate that list of keywords altogether? (To make man work like it originally did.)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,801
Original Poster
Rep:
Quote:
Originally Posted by frankbell
What do you mean by "like it originally did"?
As an aside, I use apropos to find relevant man pages.
Exactly. In the commercial versions of UNIX I've used and earlier versions of Linux, "man topic" didn't do the extensive search and provide a list of additional sections where "topic" was listed. "man" would find the first one and display it. No additional user interaction was required. "export MAN_POSIXLY_CORRECT=something" eliminates you having to do additional text entry, goes ahead and displays the first matching page, but, after viewing the manpage, "man" still displays the silly list. THAT's the part I'm looking to eliminate. "man" tries in a sort of half-baked way to be "man+a subset of apropos".
Example of what I've talking about:
Code:
$ export MAN_POSIXLY_CORRECT=1
$ man man
[man displays the man(1) manpage]
Man: find all matching manual pages <-- With that variable exported, none
* man (1) <-- of these lines need to be displayed.
man (7) <-- How does one
man (1p) <-- prevent them from appearing?
Other than exporting that shell variable -- which only half fixes the issue -- I can find no other information on how to fix the remaining half. The current "man" behavior is just broken.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,801
Original Poster
Rep:
Quote:
Originally Posted by ondoho
is this a redhat specific thing?
because on my systems (archlinux, debian stable) man behaves in the desired way, without me having to add anything.
You may be onto to something... I'm seeing this on OpenSUSE. I don't have any other distributions online at the moment--except for a really, really, old version of RedHat--that I can check at the moment.
If nobody's seeing this happen on non-OpenSUSE distributions, am I able to move this over to the SUSE/OpenSUSE forum? Or is that action reserved for a moderator?
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,801
Original Poster
Rep:
Quote:
Originally Posted by astrogeek
Apparently this was a change made with OpenSuse 11.1 ...
I have never seen this behavior in my own distro(s) of choice, Slackware and FreeBSD, and have been unable to reproduce it...
Thanks for that info. I use OpenSUSE is at home and I know it's been the way man has been working for me for some time---and getting increasingly annoying during those times when I'm not running X (with xman conveniently available on the panel). I'd never seen it on the RH or CentOS boxes at work but nobody could remember doing anything to alter the way man worked when they built the system images.
It's been quite a while since I loaded the source code for anything other than the kernel. I'll take a look at man's sources and see how gnarly it would be to make a change.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.