Skip to content

Instantly share code, notes, and snippets.

@charego
Created January 5, 2018 15:39
Show Gist options
  • Save charego/efb7ebe272308bdd2b838b344c07d082 to your computer and use it in GitHub Desktop.
Save charego/efb7ebe272308bdd2b838b344c07d082 to your computer and use it in GitHub Desktop.
Run tcpdump on the specified host
#!/bin/bash
HOSTNAME=${1:?Specify the hostname to run tcpdump on}
LOGFILE="/tmp/$HOSTNAME.tcpdump"
sudo tcpdump -i any host $HOSTNAME -w "$LOGFILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment