See /help $lines

And yes, the /filter command would be ideal for your second point.