This question already has an answer here:

I created a simple tex file: sample1.tex

  Hello World!

I used command:

pdftex sample1.tex

log file is:

This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6) (format=pdftex 2013.10.9)  17 MAR 2016 18:50

entering extended mode
 %&-line parsing enabled.
! Undefined control sequence.
l.1 \documentclass
! Undefined control sequence.
l.2 \begin
[1{/usr/share/texmf/fonts/map/pdftex/updmap/pdftex.map}] )</usr/share/texmf/fon

Output written on sample1.pdf (1 page, 6933 bytes).
PDF statistics:
 10 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 131072)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

Output pdf is as: article document Hello World!

Results are not as expected

marked as duplicate by David Carlisle, Mike Renfro, user13907, Werner, darthbith Mar 17 '16 at 14:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged or ask your own question.