Quote:
Originally Posted by rng
Sometimes I know of only part of a command, e.g. systemd commands. So I can use the script to find all commands related to systemd.
|
Say I'm on a machine that has a set of configuration commands and they all start with "system-config" (I'll limit output with "|head -2").
'whatis' doesn't like partial input so you have to know more:
Code:
~]$ whatis system-c
system-c: nothing appropriate|head -2
~]$ whatis system-config
system-config-date (8) - graphical interface for changing system date and time
system-config-date (rpm) - A graphical interface for modifying system date and time
but with 'apropos' that's no problem:
Code:
~]$ apropos system-c|head -2
system-config-date (8) - graphical interface for changing system date and time
system-config-date (rpm) - A graphical interface for modifying system date and time
'locate' is even more useful as it allows you to use a regex. Here I anchor with "bin/" as it matches both common bin and sbin directory names:
Code:
locate -er bin/sy.*-conf|head -2
/usr/bin/system-config-authentication
/usr/bin/system-config-date
and note expressions like "^.*local/[sb,b]in/[a,c].*" are no problem.
'man' can behave like whatis and apropos so I won't go into that, this command doesn't display file locations but finds all man pages and allows you to "step" through them. A plain "q" keypress quits displaying the current one and moves on to the next.
Code:
~]$ man -a system-conf*
As you can see there's multiple ways to get what you want (as long as the system can run makewhatis, updatedb and other such cron jobs regularly).
In your case try running
Code:
locate -er bin/system.*