#!/usr/bin/env ruby path = ENV['PATH'].split(':') all = [] path.each do |p| all.push(Dir.entries(p)) end puts all.flatten.select{ |a| a != '.' && a != '..' }