#! /usr/local/bin/perl for $dir (split(/:/,$ENV{PATH})) { opendir(DIR,$dir); while($_=readdir(DIR)) { print "$dir/$_\n" if /$ARGV[0]/o; } }