Find.find by block
require 'find' Find.find('./') do |path| Find.prune if File.basename(path) == 'subdir2' puts path end