Locating commands with a simple Python script
Thursday, October 27th, 2005 This script is pretty simple. It lets you find commands by entering a string. Any commands which contain that string will be displayed. For example, running python cmdfind.py find returns:
./cmdfind.py
/sbin/findfs
/usr/X11R6/bin/find
/usr/X11R6/bin/find2perl
/usr/X11R6/bin/findsmb
/usr/X11R6/bin/gst-typefind-0.8
/usr/X11R6/bin/xfindproxy
/usr/bin/find
/usr/bin/find2perl
/usr/bin/findsmb
/usr/bin/gst-typefind-0.8
/usr/bin/xfindproxy
/usr/kde/3.3/bin/dcopfind
/usr/kde/3.3/bin/kappfinder
/usr/kde/3.3/bin/kfind
/usr/qt/3/bin/findtr
Here is the script itself:
#!/usr/bin/python2.3
“””
This script does a partial search for a command name in your path.
Usage:
cmdfind
[…]