Skip to content

Instantly share code, notes, and snippets.

@bkmeneguello
Created January 21, 2014 01:12
Show Gist options
  • Save bkmeneguello/8532553 to your computer and use it in GitHub Desktop.
Save bkmeneguello/8532553 to your computer and use it in GitHub Desktop.
Rename files based on folder's name
#!/bin/bash
i=1
for f in $(ls); do
printf "mv %s %s_%03d.jpg\n" $f $(basename $(pwd)) $i
i=$(expr $i + 1)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment