Skip to content

Instantly share code, notes, and snippets.

@darshilv
Created January 19, 2017 20:50
Show Gist options
  • Save darshilv/443484f495369251c0b10ef8386c8182 to your computer and use it in GitHub Desktop.
Save darshilv/443484f495369251c0b10ef8386c8182 to your computer and use it in GitHub Desktop.
find files in current directory and subsequent directories within it and rename them
for f in `find . -type f -name "Enagement*" -prune -o -depth +1 -print | grep -e "/Engagement*"`
do
filepath=`echo $f | awk -F "/" '{print $2}'`
filename=`echo $f | awk -F "/" '{print $3}'`
newName="./$filepath/""Sko$filename"
mv $f $newName
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment