Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
Last active December 27, 2015 01:29
Show Gist options
  • Save tkuchiki/7245667 to your computer and use it in GitHub Desktop.
Save tkuchiki/7245667 to your computer and use it in GitHub Desktop.
同じ format のファイル名を変更する
#!/bin/sh
# $1 : path to dir
# $2,$3 : regex (sed format)
FILES=`find ${1} -type f`
for FILE in $FILES; do
RENAMED=`echo ${FILE} | sed -e "s/$2/$3/g"`
mv $FILE $RENAMED
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment