Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I looked at this question Mark PDF as Adobe PDF and one of the answers says:

In my document headers created with LibreOffice, the version 1.4 is having fewer header information.

What header information is this and how can I view it? For all type of files if possible.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

you can use some command that read the hexadecimal of a file like hexdump and then read the header from the right panel example:

hexdump -C  Desktop/somefile | head

The output is:

00000000  ff d8 ff e0 00 10 4a 46  49 46 00 01 01 00 00 01  |......JFIF......|
00000010  00 01 00 00 ff fe 00 3b  43 52 45 41 54 4f 52 3a  |.......;CREATOR:|
00000020  20 67 64 2d 6a 70 65 67  20 76 31 2e 30 20 28 75  | gd-jpeg v1.0 (u|
00000030  73 69 6e 67 20 49 4a 47  20 4a 50 45 47 20 76 38  |sing IJG JPEG v8|
00000040  30 29 2c 20 71 75 61 6c  69 74 79 20 3d 20 39 30  |0), quality = 90|
00000050  0a ff db 00 43 00 03 02  02 03 02 02 03 03 03 03  |....C...........|
00000060  04 03 03 04 05 08 05 05  04 04 05 0a 07 07 06 08  |................|
00000070  0c 0a 0c 0c 0b 0a 0b 0b  0d 0e 12 10 0d 0e 11 0e  |................|
00000080  0b 0b 10 16 10 11 13 14  15 15 15 0c 0f 17 18 16  |................|
00000090  14 18 12 14 15 14 ff db  00 43 01 03 04 04 05 04  |.........C......|

as you see this show me that this file is a jpeg image.

Another option is xxd

xxd Desktop/somefile | head

gives same output of above.

share|improve this answer
1  
Is this the same as mime type? –  Parto Mar 13 at 11:16
    
@AvatarParto yes –  Ask Mar 13 at 11:18
    
But this seems to have more info than a mime type –  Parto Mar 13 at 11:20
    
it looks like with more information please check this for more information freeformatter.com/mime-types-list.html –  Ask Mar 13 at 11:23
    
The mime type for a JPG is just 'image/jpeg'. The header file includes the creator and quality too. And I'm sure this info changes depending on the type of file. –  Parto Mar 13 at 11:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.