title: Is there a way to force tcpdump to print only hex format when reading CAN packets?
body: <p>Although the can-utils package is available in Linux to interact with CAN network devices, I am trying to confirm if tcpdump can print just hex format when reading CAN packets without including ASCII characters? </p>
  
  <p>tcpdump version 4.2.1
  libpcap version 1.1.1</p>
  
  <p>The only work around was I found was to direct the tcpdump output to a file then read from said file using a util like hexdump, xxd, or OD, etc.</p>
  
  <p>The upper left screen is based on the script below:</p>
  
  <pre><code># tcpdump -ivcan0 -s0 -x -w - -s0 -l &gt; canpackets.hex &amp; tail -f canpackets.hex | hexdump -vC
  </code></pre>
  
  <p>The upper right screen represents the tcpdump output using (-x) without redirecting to hexdump; which still prints ASCII.</p>
  
  <p>The bottom left screen is candump; which is here just to illustrate the hex values that are generated by the cangen util in the bottom right screen. </p>
  
  <pre><code>while :; do ./cansend vcan0 001#1122334455667788; sleep .25; done
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/qC10W.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qC10W.png" alt="enter image description here"></a></p>