Benches macOS

13

Can't find man pages

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

When using the command line interface, my new PowerBook G4 running 10.4.2 can't find any manual entries for the man command. For example, if I type "man ls", it returns the following: No manual entry for ls. Anyone have any idea what is wrong?

13 replies

Sign in or join Beachball Help to reply.

  1. 0

    Michael Conniff

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Scott

    Welcome to Apple Discussions!!

    What does Terminal have to say to this command?

    echo $MANPATH

    You should get something like

    /Users/yourloginname/man:/usr/local/share/man:/usr/share/man

    If you don't get this, post what it says.

  2. 0

    Scott Stagg

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    echo $MANPATH returns the following:

    /usr/man:/usr/X11R6/man

  3. 0

    Michael Conniff

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Scott

    Well, maybe that's your problem! On my 10.4.2 I get:

    $ cd /usr/man
    bash: cd: /usr/man: No such file or directory

    but I do have a "/usr/X11R6/man".

    The important directory you are missing is "/usr/share/man" ("/usr/local/share/man" doesn't exist on my machine either).

    I don't know why you have this problem, unless you've installed something that meddles with MANPATH. But you can get around it as follows:

    echo 'export MANPATH=$MANPATH:/usr/share/man/' >> ~/.bash_profile

    Then you will need to restart Terminal for this to have an effect: check again with
    echo $MANPATH. Of course, if you're using a shell other than
    bash, you will need to modify accordingly.

  4. 0

    Scott Stagg

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Ahh, this is helpful. When I manually set the MANPATH, man works again. However, what I'd like to do is make the change globally so every user on the machine doesn't have to modify their .cshrc ( or .profile ). Another thing I've discovered is that the problem is only in X11. If I launch "Terminal" and try using man, it works with no problems. So there must be something wrong with my /etc/X11/xinit file, but I'm nervous about mucking around with that file. I know man worked with X11 in OS 10.3. Do you know if something has changed? Do you have any recommendations?

    Thanks a bunch.

  5. 0

    Michael Conniff

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Scott

    OK, that fix will work whenever you start
    bash as a login shell. You can make it work for non-login shells by

    echo 'export MANPATH=$MANPATH:/usr/share/man/' >> ~/.bashrc
    echo 'source ~/.bashrc' >| ~/.bash_profile

    But if you want to make it global, you would use

    echo 'export MANPATH=$MANPATH:/usr/share/man/' >> /etc/bashrc

    This relies on the fact the the "/etc/profile" as shipped, will source the "/etc/bashrc" file. Note there is no leading period on these two files.

    I'm afraid I am very rusty on X11. You will almost certainly get some answers if you post in the
    UNIX forum.

  6. 0

    Jeff Hubbach

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I hate to contradict a level 4, but I disagree with manually setting MANPATH.

    I don't have anything set in my MANPATH and man works just great. From the manual page for man itself:

    "If you don't specify -M but set the MANPATH environment variable, the

    value of that variable is the list of the directories that man

    searches.

    If you don't specify an explicit path list with -M or MANPATH, man

    develops its own path list based on the contents of the configuration

    file /usr/share/misc/man.conf. The MANPATH statements in the configu-

    ration file identify particular directories to include in the search

    path.

    Furthermore, the MANPATH_MAP statements add to the search path depend-

    ing on your command search path (i.e. your PATH environment variable).

    For each directory that may be in the command search path, a MAN-

    PATH_MAP statement specifies a directory that should be added to the search path for manual page files. man looks at the PATH variable and

    adds the corresponding directories to the manual page file search path.

    Thus, with the proper use of MANPATH_MAP, when you issue the command

    man xyz, you get a manual page for the program that would run if you

    issued the command xyz."

    What does that mean? man configures manpath on its own by looking at 2 things: /usr/share/misc/man.conf and your PATH. Rather than having to manually maintain MANPATH, just unset it and let it take care of itself. Unless you're putting man pages in a weird place, everything just works.

  7. 0

    Michael Conniff

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Jeff

    Well, I have to agree with you. I don't set MANPATH in any of my rc files. But in this instance Scott seems to have lost the most important man directory, and I have no idea why. It is likely something he installed has explicitly set MANPATH, but where to start looking?

  8. 0

    Jeff Hubbach

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Michael, I'd check (in this order):

    /etc/profile

    ~/.bash_profile

    ~/.bash_login

    ~/.profile

    ~/.bashrc

    And if those files source any other files, check those.

    You could do:

    grep MANPATH /etc/profile

    grep MANPATH ~/.bash_profile

    grep MANPATH ~/.bash_login

    grep MANPATH ~/.profile

    grep MANPATH ~/.bashrc

    remove any instances where MANPATH is being explicitly set in these files, then if that doesn't correct it, go through again and grep for "source", then taking the argument to source (filename) and grepping for MANPATH.

    Alot of work, I agree, but you'll end up with a cleaner, simpler to maintain system in the end.

    Edit: and looking at my /etc/profile, it sources /etc/bashrc (but not using "source", as I'd expect). Therefore, I'd add /etc/bashrc to the list, and also change the part where you're looking for other included files. You might have to go through each file by hand, looking for any other file references.

  9. 0

    Michael Conniff

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Jeff

    Thanks for posting that, but you should have addressed it to Scott, not me!

    Also, note what Scott said in post
    1.1.1.1:

    " Another thing I've discovered is that the problem is only in X11"

    So I would think Scott wouldn't find much in those files you listed (many of which may well not exist). I told him my X11 was rusty, so if you have an equivalent list of X11 files, why don't you post that?

  10. 0

    Jeff Hubbach

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    The only difference between X11 xterm sessions and Apple Terminal sessions is that one opens a login shell (X11's xterm), and the other does not (Apple's Terminal).

    What does that mean? A login shell (X11 xterm) will read, in this order:

    /etc/profile

    ~/.bash_profile

    ~/.bash_login

    ~/.profile

    A non-login shell (Apple Terminal), will read, in this order:

    ~/.bashrc

    So, if you want all shells to behave the same, do the following:

    Put all your aliases, PATH stuff, etc that you don't want system-wide into ~/.bashrc. Don't put anything in .profile or .bash_login, and in .bash_profile, have one line:

    source .bashrc

    Now all terminals will behave the same. X11's xterm and Apple's Terminal.

  11. 0

    Kyle Skrinak

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Jeff:

    This is tremendous! In 5 paragraphs you answer what ails my Mac and X11.

    Too bad Apple's web site doesn't allow the awarding of "profoundly positive" vote. If there's a UNIX FAQ -- this belongs there.

    So let's up the ante -- what if I want to run zsh as my shell?

    Kyle

  12. 0

    Rachel Anasteli

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    yes, I agree-- very helpful advice.

    thanks! you solved my problem too!

    -Rachel

  13. 0

    Tobiah P. Fernsler

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I have the same problem. I looked all over for where my MANPATH was being set, and couldn't find it. So I just defined it in my .bashrc file. If someone out there has new ideas of where the erroneous manpath is being defined I'd love to hear about it. Nonetheless the discussion was very helpful.

    Toby