in reply to find a forgotten shell command

Nice hack. In case you weren't aware, there is also the command apropos at your disposal to find forgotten (or unknown!) commands relating to a specific subject.

It works by examining commands for which man pages exist, and scans the one-line explication of the command. apropos, then, simply greps for your text among the resulting data set. (Of course, it's all built ahead of time to make searches faster).

None of the machines here (Solaris, FreeBSD, Linux...) have a thing called 'tzconfig', so I can't decide whether this would have helped, but there you are.

  • Comment on Re: find a forgotten shell command (use apropos)

Replies are listed 'Best First'.
Re: find a forgotten shell command (use apropos)
by b10m (Vicar) on Jan 07, 2004 at 11:53 UTC

    `apropos` is not to find "forgotten (or unknown!) commands", but rather a manual page relating to a specific subject. On my machine, `tzconfig` doesn't have a manual page (it's nothing more than a shell script), so nothing will show up.

    But why not use `locate` with a grep on bin? In this specific example (tzconfig), that helped me more than this perl snippet, since "/usr/sbin" is not in my $PATH.

    $ locate tzconfig | grep bin /usr/sbin/tzconfig

    Or if you know you've recently used the command, `history` will guide you, and if you know the first n letters of your command, and the application is in your path, a double [Tab] will do just fine :)

    # tz[Tab][Tab] tzconfig tzselect # tz
    --
    b10m