SED command

big__ross

New Member
Joined
Jan 30, 2020
Messages
2
Reaction score
1
Credits
0
Hi

I was hoping that someone could point me in the right direction as I am going around in circles. I want to extract the RX packet count value from ifconfig for the NIC called eth0.

The best I have is - ifconfig eth0 | sed -e 's/RX packets \(.*\)bytes/\1/'

The RX packet count value is present in between "RX packets " and "bytes". When I run the command above it ends up giving me the full ifconfig response but with the text "RX packets " and "bytes" removed.

Ross
 



Staff online

Members online


Latest posts

Top