Skip to content

Instantly share code, notes, and snippets.

@taisyo7333
Last active January 26, 2017 08:27
Show Gist options
  • Save taisyo7333/2cac919d47d6d6ef6416c4192f033f60 to your computer and use it in GitHub Desktop.
Save taisyo7333/2cac919d47d6d6ef6416c4192f033f60 to your computer and use it in GitHub Desktop.
Macでrename & grep置換

rename

http://plasmasturm.org/code/rename/

rename 's/(\d+)_create_([a-z_]+).rb/$2.rb/' *

変換前

20171101090000_create_test_hoge.rb

変換後

test_hoge.rb

grep置換

grep -l 'Create' *.rb | xargs sed -i.bak -e 's/Create//g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment