For those like-minded as me, and running linux:
#! /bin/bash
echo -n > .hidden
for i in *.out; do echo "$i" >> .hidden; done
for i in *.log; do echo "$i" >> .hidden; done
for i in *.aux; do echo "$i" >> .hidden; done
for i in *.bbl; do echo "$i" >> .hidden; done
for i in *.blg; do echo "$i" >> .hidden; done
for i in *.dvi; do echo "$i" >> .hidden; done
for i in *.toc; do echo "$i" >> .hidden; done
for i in *.synctex.gz; do echo "$i" >> .hidden; done
Put this bash shell in your path, to do that put this line:
export PATH=$PATH:∼/scripts
into your ∼/.bashrc
file
(in this example ~/scripts is the folder containing the bash shell above), this can be at the end of that file. Maybe you also have to run this file from the terminal, but this will ensure you can run this script anywhere, wherever you're keeping it.
Now you run this script in the terminal, while being in the directory needing cleaning and run the shell. That means that if the script is named tex.clean, you'd browse to the folder needing cleaning in terminal, enter
tex.clean
in the terminal, and browse to the file in the graphical file browser, and it should be clean :)
All the file with endings mentioned in the shell will be written to that directory's .hidden
file. This means they will be hidden, but still usable :).
In nautilus (at least in fedora distributions) ctrl+h will show or hide hidden files.
P.S. I tried to have this as detailed as I could so people new to bash and command line like me could use this. I hope I succeeded :).
filename.tuc
. So overall, only two extra files are written:filename.tuc
andfilename.log
. If you want, you can compile the document usingcontext --purge filename.tex
which will delete the.tuc
and.log
files at the end of the run.