You can define the style of line numbers using the following command:
\lstdefinestyle{numbers}{numberstyle=\tiny}
The appearance of the code can be determined using:
\lstset{basicstyle=\small}
You can replace \tiny and \small with your own style specifications.
source share