Unix - extract files with certain number of lines
<p>(as an example), I have 10 files, named as such; file_name1.txt, file_name2.txt, file_name3.txt etc.</p>

<p>Each file has between 1-10 lines in it.</p>

<p>I want a command that will only print the files with a certain number of lines. i.e. I want to say <strong>print the file names if that file has 1 line</strong>, and then <strong>print the file names with 2 lines</strong> etc.</p>

<p>So I know to count the number of lines in the file it's <code>wc -l filename</code>, what's the next part, to say <code>if wc -l filename == 1, print filename</code>?</p>