My Environment:
CentOS 6.5
I need to extract some part of the ELF file.
When I use dd
command as follows, I have no problem:
$dd if=a.out of=a.cut1 bs=1 skip=16
On the other hand, when I use cut
command as follows, the created file has much less size than I expected:
$cut --bytes=16- a.out > a.cut2
For example, I created a.out by compiling the following sample c program with gcc (v. 4.4.7):
#include <stdio.h>
int main()
{
printf("Hello world\n");
}
Then, I execute dd
and cut
commands as above, I have files with following sizes:
a.out - 6415 bytes
a.cut1 - 6399 bytes
a.cut2 - 6356 bytes
I wonder why the cut
command reduces the size more than I specified.