moving files into subdirectories based off the first letter.

when building an rpm-based distribution, the standard is to put packages in subdirectories based off their name. unfortunately, the distribution gods did not bless us with a script to automate the process.

so, i wrote one.

for i in ./*; do FOLDER=$(echo $i | cut -c 3-3 | tr '[a-z]' '[A-Z]'); mv $i ./$FOLDER/ ; done

comments powered by Disqus