This is useful when you’re asked to provide only directories in a certain directory, without files or any other entities. Following recipe is for linux only.
`ls -d */`.split.collect{|f| f.gsub('/','')}
Main command here is ls -d */ which will provide you with the list, but some times you may want to have nice output and that’s where ruby comes handy