Create dated folders in Linux

For reasons too tedious to relate here, I wanted to create a lot of folders in the format:

/tmp/20120101_matt
/tmp/20120102_matt
/tmp/20120103_matt

This does the trick

for i in {0..365}
do   
  mkdir /tmp/$(date --date="+$i days" +%Y%m%d)_matt
done

Happy Christmas!

Advertisements