scripts/utilities/sort.sh

19 lines
243 B
Bash
Executable File

#!/bin/bash
extension=""
echo "Type an extension to sort"
read extension
to_sort=$(find . -name "*.${extension}");
mkdir sorted;
counter=1
for file in $to_sort; do
mv ${file} sorted/$counter.${extension}
((counter++))
done
echo "Done"