Exclude One Port from a TCPDUMP Output

Excluding one port from a tcpdump output is easy. Use the below syntax to make sure the port is excluded as both a source and destination in the tcpdump output.


  1. tcpdump -n not dst port 22 and not src port 22

You might issue the above command if you are connected to the server via SSH and you do not want that connection to show in your tcpdump results.