You can use tcpdump command to save your packets. You can pass -w in tcpdump command. It will save the output in a file as shown below.
$ tcpdump -w 0001.pcap -i eth0
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
4 packets captured
4 packets received by filter
0 packets dropped by kernel
Hope this will help you!
To know more about it, go for Linux certification course today.