clear directory according to file types