Sometimes you need to delete a bunch of files that has a limit number of lines. One option is to see one by one and rm it. But you can make you day more agile using the follow commands together 🙂
find <directory> -type f -exec sh -c '[ $(wc -l < "$1") -lt 20 ] && rm -- "$1"' inline {} \;
Let’s explain what it does. <directory> is the folder where the files you want to delete are. I set 20 lines as minimum, just change it using your criteria.
find -type f, says that is a file we are looking for. -exec sh says we want to execute some command for each entry we find using find <dir> -type f. In our case  we exec a sh -c. The -c options says to sh<ell> that we will run a inline code without open a file with shell commands. The follows commands into ” says we want to count the number of line in entry file $1 and if it is less than 20 we’ll delete it. inline and {} \; are just some find command conventions.
References:
[1]Â http://stackoverflow.com/questions/935251/linux-delete-files-that-dont-contain-specific-number-of-lines