Skip to content

Instantly share code, notes, and snippets.

@joshwnj
Created May 21, 2012 22:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshwnj/2765034 to your computer and use it in GitHub Desktop.
Save joshwnj/2765034 to your computer and use it in GitHub Desktop.
give me a list of files from the month of May 2011
## give me a list of files from the month of May 2011
ls -laht --color=never | egrep 'May[ ]+[0-9]+[ ]+2011(.*)' | sed 's/.*2011 / /'
## move them to a separate directory
mkdir may-2011; ls -laht --color=never | egrep 'May[ ]+[0-9]+[ ]+2011(.*)' | sed 's/.*2011 / /' | xargs -I {} mv {} may-2011/
@westonruter
Copy link

Handy :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment