Skip to content

Instantly share code, notes, and snippets.

@ignaciolg
Created September 16, 2021 13:41
Show Gist options
  • Save ignaciolg/68e703e5e612a460687076301bfb6b9b to your computer and use it in GitHub Desktop.
Save ignaciolg/68e703e5e612a460687076301bfb6b9b to your computer and use it in GitHub Desktop.
rename/normalize files in mac
for i in *; do mv "$i" "$(echo $i|tr "A-Z -" "a-z_")"; done
# for i in *; do <command>; done # execute command for all files in folder
# mv "$i" ... # move the file to the destiny
# "$(echo $i|tr "string" "string")"# execute echo of the file, and pass it to tr to transform the string. the result will be used by mv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment