In addition to tcpdump, I'd like to add the command 'tshark'. Tshark usually comes bundled with wireshark and allows you to use the same search capabilities as wireshark from the command line. I find it much easier to use than tcpdump especially if you already have experience with wireshark.