Skip to content

Instantly share code, notes, and snippets.

@guypursey
Created November 30, 2014 13:28
Show Gist options
  • Save guypursey/ad548f7bf935ac7a2bf3 to your computer and use it in GitHub Desktop.
Save guypursey/ad548f7bf935ac7a2bf3 to your computer and use it in GitHub Desktop.
Rename folders and main file within to new convention.
for file in $(find * -maxdepth 0 -type d); do
newdirnm=${file:0:4}${file:5:2}${file:8:2}${file:11:2}${file:14:2}-${file:17}
mv $file $newdirnm
cd ./$newdirnm
git mv "$file".md "$newdirnm".md
git commit -m "Optimised filename for SEO."
cd ..
../autoscrp.sh $newdirnm
echo $newdirnm
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment