Skip to content

Instantly share code, notes, and snippets.

@TheAnonymous
Last active December 23, 2015 19:29
Show Gist options
  • Save TheAnonymous/6682751 to your computer and use it in GitHub Desktop.
Save TheAnonymous/6682751 to your computer and use it in GitHub Desktop.
This script searches& deletes files that nobody needs execpt LaTex itself. So whe you normally makea PDF with LaTex you have n files laying around which you done need this makes it hard to see the files which are important. This Script searches and deltes them. Watches if md5sum of pdf changed and if yes then deletes files which where prodouced …
#!/bin/bash
while [ 1 ]
do
hash2=$(md5sum `find -iname "*.pdf"`|awk '{print $1}')
sleep 2
hash=$(md5sum `find -iname "*.pdf"`|awk '{print $1}')
if [ $hash2 != $hash ]
then
echo "Delted some unused files"
rm `find -iname "*.aux" -o -iname "*.out" -o -iname "*.fls" -o -iname "*.bbl" -o -iname "*.blg" -o -iname "*.fdb_latexmk" -o -iname "*.lof" -o -iname "*.lot" -o -iname "*.toc"`
fi
done
md5sum `find -iname "*.pdf"`|awk '{print $1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment