Skip to content

Instantly share code, notes, and snippets.

@etaf
Created December 31, 2015 02:59
Show Gist options
  • Save etaf/7635f163a51b902a4532 to your computer and use it in GitHub Desktop.
Save etaf/7635f163a51b902a4532 to your computer and use it in GitHub Desktop.
rename filename using regex
rename file:
2015-01-21-hello.md
2015-04-02-word.md
to:
hello.md
word.md
for f in 2015* ; do mv $f $(echo $f | sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}-//') ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment