Finding command names on AIX using the Korn Shell
brian_s 270002K5X3 Comments (3) Visits (6302)
By far my favorite shell is the Bash shell. It has all kinds of awesome features including tab filename completion and tab command completion. Unfortunately Bash is not included with AIX by default, so a lot of the time we have to make the best of the Korn shell.
With AIX's Korn shell you can do a "set -o vi" and then hit "ESC \" to get filename completion. But this doesn't work for command name completion. For example, if you type "hostna" and then hit "ESC \" it won't autocomplete to "hostname".
I really like command name completion with bash. It makes it really easy to find command names that you can't quite seem to remember. For example if you were trying to remember the names of the commands to vary on and off volume groups you could just type "vary" and hit tab and see all the commands that start with the word "vary".
Here is a little alias for the Korn shell that will make it easier to find command names:
Basically this alias will look through every file in each directory in your $PATH. If the file is executable, it will be displayed. Thus, if you type "lscmd" you will see a list of all executable commands.
You can also run something like "lscmd | grep vary" to see commands that contain the word "vary" in them:
Or you could look for commands that contain "lv" in the name: