Skip to content

Instantly share code, notes, and snippets.

@aokj4ck
Created March 8, 2013 16:56
Show Gist options
  • Save aokj4ck/5117954 to your computer and use it in GitHub Desktop.
Save aokj4ck/5117954 to your computer and use it in GitHub Desktop.
Wanted to rename a folder of images to a prefix with a number after each. Hacked this up instead of renaming them manually. Requires modifying to whatever prefix and filetype you want.
#!/bin/bash
count=1
files="$(ls)"
for X in $files
do
mv $X "prefix${count}.filetype"
count=$((count+1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment