Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Finding UNIX commands using 'apropos' UNIX
As you get more adventurous in terminal mode, you may wish to explore UNIX commands to get your work done. There's a command called "apropos" that searches all the man(ual) pages for keywords, and voila, a list of appropriate commands appear.

BUT - OS X's "apropos" doesn't work until you establish a "whatis" database. How? Simple:

1) Start a terminal session and get into su mode (root).

2) Type the follow line exactly:
/usr/libexec/makewhatis

3) Wait several seconds for the root prompt to appear, and quit the terminal session.

Now, you can start a terminal session as yourself, and the "apropos" command will work. For more information about apropos, type "man apropos".

[Editor's note: I published a related tip quite a while back, but I'm sure not everyone has dug through all the pages, so I thought this was a good chance to bring it up again. Note that the makewhatis will also run if you leave your machine on regularly; it's part of a scheduled task that runs (if I recall correctly) weekly.]
    •    
  • Currently 3.33 / 5
  You rated: 4 / 5 (3 votes cast)
 
[6,831 views]  

Finding UNIX commands using 'apropos' | 3 comments | Create New Account
Click here to return to the 'Finding UNIX commands using 'apropos'' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Enhance this hint
Authored by: Londo on Apr 11, '01 10:57:54AM

Before executing the /usr/libexec/makewhatis I'd
check out the contents of my $MANPATH variable since
the default to this command only checks /usr/share/man.
Hence, echo $MANPATH shows for me:
/var/root/man:/usr/local/share/man:/usr/share/man
so executing
/usr/libexec/makewhatis $MANPATH
should include this extra documentation for the whatis db created.



[ Reply to This | # ]
whatis weekly update
Authored by: Newt on Apr 11, '01 04:15:47PM

Good enhancement. And BTW the editor is right. The both whatis and locate databases are updated weekly. As an FYI, by default the system looks in /usr/share/man and /usr/local/man (and /usr/X11R6/man if it exists).

Newt



[ Reply to This | # ]
su mode
Authored by: mgspongebob on Dec 02, '02 01:03:19AM

how do i get into su mode?



[ Reply to This | # ]