Skip to content

Instantly share code, notes, and snippets.

@013231
Created July 8, 2012 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 013231/3070206 to your computer and use it in GitHub Desktop.
Save 013231/3070206 to your computer and use it in GitHub Desktop.
#!/bin/sh
count=0
IFS=$'\n'
for filename in `find *.txt`
do
destDir="AAA$((count / 500 + 1))"
if (($count % 500 == 0 ))
then
echo mkdir $destDir
mkdir $destDir
fi
echo mv $filename $destDir
mv $filename $destDir
count=$((++count))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment