sudo tcpdump -s0 -i pktap,en0 -k NP -Q "proc =Python" port 443 or 80
sudo tcpdump -A -s0 -i pktap,en0 -k NP -Q "proc =Python" port 443 or 80
sudo tcpdump -X -s0 -i pktap,en0 -k NP -Q "proc =Python" port 443 or 80
-A= ASCII printing-s0= size of packet to capture, 0=65535-i= interface to listen on (note here that en0 is specified as a PKTAP-wrapped interface so we get process name, etc.)-k= metadata fields to print,N=process name,K=PID (as processName:PID)-XPrint content as both hex and ascii-Q= filter expression. Can have multiple sub-expressions grouped within parenthesesport = port to include packets from, multiple can be specified with "or"
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/tcpdump.1.html