Dir.entries returns an array with all the entries within the specified directory. Dir.foreach provides the same feature, but as an iterator:
Dir.foreach("/usr/bin") do |entry| puts entry end