I'd like to execute the command latexmk -c
on all of the directories inside a directory, e.g.,
.
./test-dir
The effect is to remove all of the auxiliary files created curing latex compilation.
I've tried using the find
command to tell me about the directories and then execute a command, like so:
find -type d -exec latexmk -c \;
But unfortunately, that command only has the effect of removing the auxiliary files in the directory in which I call it, not in the subdirectory (test-dir
in this example).
I had a very similar problem: I wanted to convert .tex files recursively. The final solution for me was:
The secret here is to use
-execdir
instead of-exec
which executes the command in the directory the file was found. So the solution to your problem is most likely: