Skip to content

Instantly share code, notes, and snippets.

@lucasassisrosa
Last active January 19, 2024 12:07
Show Gist options
  • Save lucasassisrosa/6c5d1246b3514e7b3003d08a830cccc5 to your computer and use it in GitHub Desktop.
Save lucasassisrosa/6c5d1246b3514e7b3003d08a830cccc5 to your computer and use it in GitHub Desktop.
Rename folder all files extensions
# transform all files to .md, including nested. Use -n to preview changes
rename -p -e 's/(\/.*)\.php/$1\.md/' **/*.php
rename -p -e 's/(\/.*)\.py/$1\.md/' **/*.py
rename -p -e 's/(\/.*)\.rb/$1\.md/' **/*.rb
rename -p -e 's/(\/.*)\.java/$1\.md/' **/*.java
rename -p -e 's/(\/.*)\.cs/$1\.md/' **/*.cs
# It outputs something like "'php/outbound_voice_profiles/outbound_voice_profiles/get.php' would be renamed to 'php/outbound_voice_profiles/outbound_voice_profiles/get.md'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment