Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A bash script to clean latex temp files
#!/bin/bash
# Note: you might prefer latexmk -c since latexmk is great. It doesn't clean all of these, but see
# https://tex.stackexchange.com/questions/83341/clean-bbl-files-with-latexmk-c/83386#83386
exts=".aux .lof .log .lot .fls .out .toc .dvi .bbl .bcf .blg -blx.aux -blx.bib -blx.bib .run.xml .fdb_latexmk .synctex.gz .syntex.gz(busy) .pdfsync .algorithms .alg .loa .thm .nav .snm .vrb .acn .acr .glg .glo .gls .brf .lol .idx .ilg .ind .ist .maf .mtc .mtc0 .pyg .nlo .tdo .xdy .keys"
for x in "${@:-.}"; do
arg=$(echo ${x:-.} | perl -pe 's/\.(tex|pdf)$//')
if [[ -d "$arg" ]]; then
for ext in $exts; do
rm -f "$arg"/*$ext
done
else
for ext in $exts; do
rm -f "$arg"$ext
done
fi
done
rm -rf $(biber --cache) # gross biber bug
@lawlist

This comment has been minimized.

Copy link

commented Mar 10, 2013

Thank you very much!

@AllanLRH

This comment has been minimized.

Copy link

commented Jun 3, 2013

Thanks a lot!

@hangong

This comment has been minimized.

Copy link

commented Dec 1, 2014

Good!

@Agachon06

This comment has been minimized.

Copy link

commented Jan 21, 2016

Thx !

@zlatko-minev

This comment has been minimized.

Copy link

commented Sep 8, 2018

Yes! Saved me 5 mins

@callmexss

This comment has been minimized.

Copy link

commented May 15, 2019

THX!!!

@MingukQiu

This comment has been minimized.

Copy link

commented Jun 20, 2019

Excellent!

@leomaurodesenv

This comment has been minimized.

Copy link

commented Sep 4, 2019

Nice one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.