Linux expert Please help me with zgrep

inyournameinyourname ■□□□□□□□□□ Posts: 6Member ■□□□□□□□□□
I am searching for a specific tunnel name from the big log.

I have to search these 3 keywords.


zgrep 'ABC-123' /var/directory/log/2016-12-01/logfilename.log > /home/mydirectory/ABC-123.txt

The problem is since ABC-123 overlaps with other files.....I can't get only ABC-123.
I would get the data from ABC-123-456 as well.

How can i distinguish ABC-123 from other 2 files?


  • thomas_thomas_ CompTIA N+/S+/L+; CCNA R&S; CCNP R&S Posts: 894Member ■■■■■■□□□□
    What about:


    or whatever regex zgrep uses to represent "ends with". Or maybe just use the regex that matches a single character and repeat that character three times for the "123" part.
  • hiddenknight821hiddenknight821 ■■■■■□□□□□ Posts: 1,209Member ■■■■■□□□□□
    Have you tried the following?

    zgrep '^ABC-123$' /var/directory/log/2016-12-01/logfilename.log > /home/mydirectory/ABC-123.txt
Sign In or Register to comment.