#!/bin/bash function clean() { PATTERN_LIST=" *.acn *.acr *.aux *.alg *.gnuploterrors *.bbl *.blg *.fls *.ist *.log *.lof *lot *.maf *.mtc* *.out *.toc *.synctex.gz *_latexmk " for p in $PATTERN_LIST do find . -iname "${p}" -exec rm {} \; done [[ -d gnuplottex ]] &&rm -R gnuplottex } clean