Skip to content

Instantly share code, notes, and snippets.

@aturgarg
Created July 29, 2012 08:56
Show Gist options
  • Save aturgarg/3196826 to your computer and use it in GitHub Desktop.
Save aturgarg/3196826 to your computer and use it in GitHub Desktop.
file listing in directory
#files listing in a directory and write it to a file
ARGV.each do|a|
puts "Directory: #{a}"
dir_contents = Dir.entries(a)
puts dir_contents
end
#usage
#at cmd
#> ruby files.rb foldername > folderfiles.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment