Categories
Welcome Center
Education & Development
Discussions
Certification Preparation
Recent Posts
Groups
Free Resources
Ebooks
Free Workshops
Trending Certifications Infographic
Infosec Training
IT & Security Training
Live Boot Camps
Security Awareness Training
About Infosec Institute
Home
Certification Preparation
CompTIA
Linux expert Please help me with zgrep
inyourname
I am searching for a specific tunnel name from the big log.
I have to search these 3 keywords.
ABC-123
ABC-123-456
ABC-123-789
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?
Find more posts tagged with
Save $250 on 2025 certification boot camps from Infosec!
Book now with code EOY2025
Button
Comments
thomas_
What about:
ABC-123^
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.
hiddenknight821
Have you tried the following?
zgrep '^ABC-123$' /var/directory/log/2016-12-01/logfilename.log > /home/mydirectory/ABC-123.txt
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
INFOSEC Boot Camps
$250
OFF
Use code
EOY2025
to receive $250 off your 2025 certification boot camp!
BROWSE BOOT CAMPS