In ifcfg-eth0
, I managed to grep "DEVICE=eth0" by using
grep "DEVICE=" ifcfg-eth0
But how can I grep pattern to show only "eth0"?
greptext processing
In ifcfg-eth0
, I managed to grep "DEVICE=eth0" by using
grep "DEVICE=" ifcfg-eth0
But how can I grep pattern to show only "eth0"?
Best Answer
grep
is not really the tool for this (although versions of GNU grep offer various options that do similar things).sed
orawk
are far better suited for this task.