Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想latexmk -c对目录内的所有目录执行命令,例如,
latexmk -c
.
./test-dir
效果是删除所有创建固化乳胶编译的辅助文件。
我尝试使用该find命令告诉我有关目录的信息,然后执行命令,如下所示:
find
find -type d -exec latexmk -c \;
但不幸的是,该命令仅具有删除我调用它的目录中的辅助文件的效果,而不是子目录中的辅助文件(test-dir在此示例中)。
test-dir
我有一个非常相似的问题:我想递归地转换 .tex 文件。对我来说最终的解决方案是:
find . -name '*.tex' -execdir latexmk -pdf {} \;
这里的秘诀是使用-execdir而不是-exec在找到文件的目录中执行命令。因此,您的问题的解决方案很可能是:
-execdir
-exec
find -type d -execdir latexmk -c \;