Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

If I do pdflatex *.tex in a directory, only one tex file is compiled. Which syntax should I use that all *.tex files in the directory are compiled?

share|improve this question

2 Answers 2

up vote 6 down vote accepted


for file in *.tex; do pdflatex "$file"; done
share|improve this answer

pdflatex apparently only takes one argument. I can think of using find -exec

find -name '*.tex' -maxdepth 1 -exec pdflatex {} \;

But there may be better alternatives.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.