This is our old Q&A Site. Please post any new questions and answers at


Using Wireshark (version 1.8.4) on Windows 7, I captured a couple of hundred packets in a pcap file. (using pcap and not pcapng format). Then I used the editcap command line utility as below to retain only 184th packet.

editcap -r in.pcap out.pcap 184

I copied these two pcap files onto a Fedora Linux machine.

$ file in.pcap

small.pcap: tcpdump capture file (little-endian) - version 2.4 (Ethernet, capture length 65535)

$ file out.pcap

out.pcap: data

As seen above, Linux does not recognize file type for the output file generated by editcap.

Now I used editcap on Linux with the same command line as above and again checked file type of newly generated out.pcap

$ file out.pcap

out.pcap: tcpdump capture file (little-endian) - version 2.4 (Ethernet, capture length 65535)

Is this a bug in Windows based editcap ?



asked 14 Dec '12, 00:24

Mahendra's gravatar image

accept rate: 0%

edited 14 Dec '12, 20:30

Guy%20Harris's gravatar image

Guy Harris ♦♦


I copied these two pcap files onto a Fedora Linux machine. How did you do that? ftp in ASCII will mangle the file.

(14 Dec '12, 04:28) Anders ♦

I have unix drive mapped on my Windows PC using Samba server. So just used Windows explorer for this copy-paste.

(14 Dec '12, 10:08) Mahendra

editcap 1.8.4 writes pcap-ng by default, so if your Fedora magic file (the database used by file) does not support pcap-ng, it will simply show "data".

What is your Fedora version?

Please try to write a pcap file with editcap and then copy that to Fedora.

editcap -F libpcap -r in.pcap out.pcap 184

If that does not solve the problem, please post the output of the following command for both files on linux:

od -x file.cap | head -10


permanent link

answered 14 Dec '12, 06:33

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
accept rate: 15%

edited 14 Dec '12, 06:36

Thanks Kurt. The editcap command line you gave above worked for me.

(14 Dec '12, 10:07) Mahendra
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 14 Dec '12, 00:24

question was seen: 4,484 times

last updated: 14 Dec '12, 20:30

p​o​w​e​r​e​d by O​S​Q​A