Blog‎ > ‎

Clean Up Latex Intermediate Files

posted Jan 24, 2020, 5:52 AM by MUHAMMAD MUN`IM AHMAD ZABIDI   [ updated Jan 24, 2020, 5:53 AM ]
To delete all .bak files, here's the commands:

$ cd top_level_dir
$ find . -name "*.bak" -type f -delete

If you're afraid of deleting other files, do a dry run first:

$ find . -name "*.bak" -type f -delete

Finally, when you want to delete all the junk and keep only .tex, .bib and .pdf files, here's the commands:

$ cd top_level_dir
$ find . -name "*.bak" -type f -delete
$ find . -name "*.log" -type f -delete
$ find . -name "*.out -type f -delete
$ find . -name "*.xml" -type f -delete
$ find . -name "*.pdfsync" -type f -delete
$ find . -name "*.gz" -type f -delete
$ find . -name "*.toc" -type f -delete

Bibliography and index related files

$ find . -name "*.blg" -type f -delete
$ find . -name "*.bcf" -type f -delete
$ find . -name "*.bbl" -type f -delete
$ find . -name "*.idx" -type f -delete

Beamer files

$ find . -name "*.nav" -type f -delete
$ find . -name "*.snm" -type f -delete

Or just put all the command in a script file clean.sh, then run

$ source clean.sh

The script file in Atom:







Comments