Skip to content

Instantly share code, notes, and snippets.

@bahelms
Last active August 29, 2015 14:02
Show Gist options
  • Save bahelms/8cde38a65fbb23106a6d to your computer and use it in GitHub Desktop.
Save bahelms/8cde38a65fbb23106a6d to your computer and use it in GitHub Desktop.
Print out file system text filtered thru a ruby regex at the command line
# You can use ls, echo, grep; whatever you are looking for.
# I wanted a list of just the rails migration filename timestamps, e.g.
$ ls rails_app/db/migrate/ | xargs -n1 | ruby -e "puts $<.read.scan(/\d*/)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment