lstinputlisting excluse lines

Shell
\lstinputlisting[firstline=300,lastline=500]{file.cc}\lstinputlisting[linerange={1-4,7-9}]{file.cc}
Source

Also in Shell: