Created
August 26, 2016 19:30
-
-
Save sharpmachine/367a6aec50409c7db056bea611a1cc00 to your computer and use it in GitHub Desktop.
Batch rename commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rename directories | |
for file in $(git ls-files | grep nsg- | sed -e 's/\(nsg-[^/]*\).*/\1/' | uniq); git mv $file $(echo $file | sed -e 's/nsg-//') -vn | |
rename files | |
for file in $(git ls-files | grep nsg- | uniq); git mv $file $(echo $file | sed -e 's/nsg-//') -vn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment