Created
July 3, 2020 03:04
-
-
Save visualdensity/b4e53e8c07d4f7a4c553d1820f066ea3 to your computer and use it in GitHub Desktop.
CLI rename files
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
#### | |
# Example: | |
# | |
# $ ls -1 | |
# | |
# interface.address.ts | |
# interface.name.ts | |
# interface.contact.ts | |
# | |
# To remove all of the interface.* | |
ls -1 | sed 's/^\(interface\.\)\(.*\)$/mv \1\2 \2/' | sh | |
# the above generates: | |
# | |
# mv interface.address.ts address.ts | |
# mv interface.name.ts name.ts | |
# mv interface.contact.ts contact.ts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment