Terminal commands

Nils Kassube kassube at gmx.net
Tue Dec 23 12:26:55 UTC 2008


Brian Norman Wootton wrote:
> did you write that script off the top of your head?

Not exactly :)

> got my brain going 
> working out
> exactly what it was doing anyway.

OK, here is a description. I'm not sure which parts are bash specific:

Loop for a list of all commands in /bin /sbin /usr/bin /usr/sbin which 
start with alphanumeric characters

for f in {,/usr}/{,s}bin/[0-9a-zA-Z]*;do

strip the directory from the command name

 n=${f##*/};

Get the one line description of the command

whatis $n|

Select only manual sections 1 and 8

grep -e "^$n (1)" -e "^$n (8)";done|

get a sorted list without double entries and pipe the list through less 
for readability

sort|uniq|less

BTW: I think such a list isn't very helpful. I prefer the apropos command 
to search for a particular command.


Nils




More information about the kubuntu-users mailing list