How to Clean a Directoy Tree of LaTeX Projects

Have you ever wanted to file your LaTeX projects without temporary files generated by LaTeX and Xindy (Makeindex)? 

How to Clean a Directoy Tree of LaTeX Projects

In Mac OS X's or Linux's terminal change the current directory to the root of the directory tree containing your LaTeX projects. Then copy, past, and execute following command line:​

find .  \( -name "*.aux" -or -name "*.bbl" -or -name "*.blg" -or -name "*.log" -or -name "*.synctex.gz" -or -name "*.acn" -or -name "*.bcf" -or -name "*.lof" -or -name "*.lot" -or -name "*.nyg" -or -name "*.out" -or -name "*.syg" -or -name "*.toc" -or -name "*.ind" -or -name "*.idx" -or -name "*.xdy" -or -name "*.glo" -or -name "*.nlg" -or -name "*.nyi" -or -name "*.slg" -or -name "*.syi" -or -name "*.acr" -or -name "*.alg" \) -exec rm {} \;

The command find is seeking for temporary files in current directory (.) and all its subdirectories, followed by the execution of rm to remove them. You could also use regular expressions, see http://perso.ens-lyon.fr/adrien.barbaresi/blog/?p=812 and http://en.wikipedia.org/wiki/Regular_expression. The list of file extensions might be incomplete. However, it includes many types of temporary files created by modern tools like Xindy for indices or by (pdf)latex.