Skip to content

Instantly share code, notes, and snippets.

@Matrix7867
Created July 18, 2019 10:43
Show Gist options
  • Select an option

  • Save Matrix7867/4cd4f086dbf917107e06e2be49acf51f to your computer and use it in GitHub Desktop.

Select an option

Save Matrix7867/4cd4f086dbf917107e06e2be49acf51f to your computer and use it in GitHub Desktop.
rename any files with three digit 000 increment
#!/bin/bash
count=001
newname=segmentmembership
for i in *.json.gz;
do
c=`printf '%0.3d\n' $count`
mv $i $newname.$c.json.gz
count=$((count+001))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment