lstinputlisting line range

Shell
\lstinputlisting[firstline=300,lastline=500]{file.cc}
Source

Also in Shell: