2023-02-12 02:48:21 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-02-07 00:01:21 +03:00
|
|
|
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"
|