> ## Content Index
> Fetch the complete content index at: https://kudithipudi.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# HOW TO : Configure tcpdump to rotate capture files based on size
- URL: https://kudithipudi.org/how-to-configure-tcpdump-to-rotate-capture-files-based-on-size/
- Published: 2013-02-14T07:17:56.000Z
- Updated: 2013-02-14T07:17:56.000Z
- Description: quick note for self. If you are capturing traffic using tcpdump, you can rotate the capture files based on size [code]sudo tcpdump -i INTERFACE_TO_CAPTURE_TRAFFIC_ON -C 10...
- Author: admin
- Tags: HOWTO, Linux, Networking, Technology, Uncategorized, #wp, #wp-post, #Import 2026-08-23 02:32

quick note for self. If you are capturing traffic using tcpdump, you can rotate the capture files based on size

```
sudo tcpdump -i INTERFACE_TO_CAPTURE_TRAFFIC_ON -C 10 -s0 -W NO_OF_FILES_TO_ROTATE_THROUGH -w /PATH_TO_CAPTURE_FILE
```

explanation of the options used

**\-i** : specify the interface you want to capture the traffic on. If not specified, tcpdump will listen on the lowest numbered interface. i.e. eth0

**\-C** : specify the size of the file multiplied by 1000000 bytes. In this example, the file created would be 10000000 bytes. Or \~9.8MB

**\-s** : specify the packet length to capture. 0 (zero) tells tcpdump to capture the entire packet

**\-W** : specify the number of files to rotate through once the files size specified in -C is reached. The files keep rotating throughout the capture

**\-w** : Specify the path to the capture file. tcpdump appends an integer to the end of the file based on the number of files it has to rotate through.