Skip to content

Instantly share code, notes, and snippets.

@wcoder
Last active January 29, 2018 21:08
Show Gist options
  • Save wcoder/ef01a1e6e2bbe816ee695fa2979a5cae to your computer and use it in GitHub Desktop.
Save wcoder/ef01a1e6e2bbe816ee695fa2979a5cae to your computer and use it in GitHub Desktop.
Multiple files renaming on macOS
for j in *.bak; do mv -- "$j" "temp_${j%.bak}.txt"; done

Example:

from:
123.bak
456.bak
asd.bak

to:
temp_123.txt
temp_456.txt
temp_ask.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment