17 lines
230 B
Bash
17 lines
230 B
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"
|