regex - use grep/sed/awk to extract string corresponding to certain field -


on fedora system, following:

$  cat /proc/net/arp  ip address      hw type     flags       hw address            mask     device 130.48.0.1       0x1         0x2         80:4b:c7:10:3e:41     *        wlp1s0 

how can pipe result of device (in case answer wlp1s0) using screen editor such sed or grep or awk?

thanks!

$ awk '/^[0-9]/{print $6}' /proc/net/arp  wlp1s0 
  • /^[0-9]/ selects lines start digit, ip

  • print $6 prints 6th colum being device


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -