#dir_name = "c:/bin" dir_name = "/bin" s = [] Dir.open(dir_name) do |dir| dir.each do |d| if d[0] != "." s.push(d) end end end s.sort! puts s