> On 1/1/2008 2:00 AM, Ralph Shumaker wrote: > > Carl Lowenstein wrote: > > Anybody know of a link where I can find all the obscure (and > > not-so-obscure) command names explained? A nice bonus would be if the > > explanations would be as helpful as Carl was here and tell me ~"you > > probably don't need this one anymore if you have thus-and-such which > > essentially replaces it"~.
--- Karl Cunningham <[EMAIL PROTECTED]> wrote: > One not-very-elegant way is to hit the tab key twice at a command line > prompt. You'll see a list of commands within your PATH. Check out the > man page for any commands that strike your fancy. > > Karl Probably still not on the "elegant" side but this Bash script will grab the file names in each directory in your $PATH variable and attempt a whatis command. If a description is shown it is displayed. It may be well to run this as root (bigger $PATH) and export to a file. I called my program "explain" so to run this it would look like: ./explain > command_list Here's the program between the underscores. Note that the #! line must be on the very first line. You will have to change the permissions to make it executable (ie: chmod 700 explain) _____ #!/bin/bash path=$(echo $PATH | sed -e "s/:/ /g"); cmds=$(ls -1 $path 2>/dev/null | sort | uniq ) for c in $cmds do whatis $c | grep -v "nothing appropriate" done _____ Since this is the newbie list: 1: tells the system these commands should be run by the Bash shell 2: takes your user's PATH variable and replaces colons with spaces 3: list each file in the directories named in the PATH variable; ignore errors; sort results; show each name one time 4: loop through each name in list 5: begin loop 6: perform whatis command on name; ignore "nothing appropriate" replies 7: end loop As Karl intimated in his reply, the commands available to you will vary greatly depending your distribution and what software you have installed. Using the tab key two times will display the commands available to you in your PATH. This script does the same thing but also looks for the values in the man pages. In general, if there is an entry in this list there should be a man page for it in your system since whatis looks at the man database. Recall also that many commands will describe themselves with a --help option. James Keeline -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-newbie
