use grep to exclude lines code example
Example 1: grep exclude
Just filter your output with:
grep -v "excluded_pattern"
Example to get all not txt files in current directory.
ls | grep -v .txt
Example 2: grep specific line
sed '3,10!d' your.file # capture line 3 to 10
#same number for single line