Linux commands

From Krm
(Difference between revisions)
Jump to: navigation, search
(Created page with '== tcpdump == CDP packets 'ether[20:2] == 0x2000' PPPoE discovery, session packets pppoed pppoes')
 
 
(One intermediate revision by one user not shown)
Line 6: Line 6:
 
PPPoE discovery, session packets
 
PPPoE discovery, session packets
 
  pppoed pppoes
 
  pppoed pppoes
 +
 +
 +
== awk ==
 +
 +
Sum the numbers in a column
 +
awk '{ SUM += $1} END { print SUM }'
 +
 +
Get substring of a column
 +
awk '{print $1" " substr($2)}'

Latest revision as of 17:24, 20 December 2010

[edit] tcpdump

CDP packets

'ether[20:2] == 0x2000' 

PPPoE discovery, session packets

pppoed pppoes


[edit] awk

Sum the numbers in a column

awk '{ SUM += $1} END { print SUM }'

Get substring of a column

awk '{print $1" " substr($2)}'
Personal tools