# [Tex/LaTex] LaTeX does not generate the aux file

auxiliary-files

I am executing the following command in the terminal, but that does not generate the *.aux file:

pdflatex main.tex


Why is it not generating the main.aux file?

The writing of the .aux files in LaTeX is controlled by switch \if@filesw (w short for writable). The command \nofiles sets the switch to false to prevent the rewriting of the auxiliary files.
The main .aux file is opened for writing in \begin{document}. If the LaTeX job does not reach this point, for example, because of an error or on purpose, the auxiliary files are also not written.