As a network engineer, I’m super new to linux. Here’s an issue I encountered while using grep:
On our server, we usually and only use grep to search info in our backup logs of network devices.
Today I was searching lines including ldn01 & ABC.
I input: “grep ldn01 * | grep ABC”, there’s zero output.
But if I input: “grep -i ldn01 * | grep ABC”, there will be some outputs like:
xxxxx.ldn01: description ……..ABC…………………
yyyyy.ldn01: description …………………..ABC……
…
(ABC is an example. The actual input is also three capital letters.)
As I know, -i means ignore cases. But I can see a lot of “ldn01” in the output of “grep -i ldn01 * | grep ABC” which are in lower case. Then why can’t I search them without -i ?
After more tests, I think the outputs of “grep ldn01 *” & “grep -i ldn01 *” differ not only by the case of ldn01 but also by something I don’t know.
Sorry for not being able to provide the actual log which is internal.
Thank you very much.
System: Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-193-generic x86_64)
YI WU is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.