[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

grep: show matching line from pattern file



Not exactly Debian specific, but hoping that someone here can help.

I have a file of regex patterns and I use grep like so:

   ~$ grep -f patterns.txt /var/log/syslog 

What I'd like to get is a listing of all lines, specifically the line
numbers of the regexps in patterns.txt, that match entries in
/var/log/syslog.   Is there a way to do this?

-Jim P.



Reply to: