improvements from cleanup.bat ported to bash
Merge pull request #3 from StefanScherer/improve-cleanup-sh

improvements from cleanup.bat ported to bash