I have a lot of lines like this, produced by grep -n:
path/to/dir/file1.txt:4: Match
path/to/dir/file1.txt:40: Another Match
path/to/dir/file2.txt:2: Match
path/to/dir/file2.txt:564: Yet another Match
I'd like to eliminate lines where the line number is less than (say) 10. I know I can get the line number easily with cut -d: -f2, but how could you then use this to discard the lines and continue piping the rest of the output in full so you end up with:
path/to/dir/file1.txt:40: Another Match
path/to/dir/file2.txt:564: Yet another Match
You can do:
your command | awk -F: '$2>=10'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With