guys, in order to see the header of file (wmv,mp3, binary[pe/elf/machos], avi, etc....) which command line in unix could perform this ?

looking forward for some answers :D

link|improve this question
2  
Not programming. Did you even try the file command? – leppie Jan 25 '11 at 5:12
do you want to see the first few bytes in hex? xxd is your friend. – akira Jan 25 '11 at 9:44
feedback

migrated from stackoverflow.com Jan 25 '11 at 8:51

This question came from our site for professional and enthusiast programmers.

5 Answers

The question is a bit wide in scope, so the suggestion is to approach in steps.

  1. Use file command to get first level information: File (Unix).
  2. Then subsequently use FFMPG for audio video headers.
  3. And dump for object files.

See also: ffmpeg command line options

link|improve this answer
feedback

head will show the first few lines of code in a file.

A 'good' way of getting it into hex, pull the file into gvim and in the 'menu' (if you don't like typing abstract commands) there is an option to put the data through xxd getting it into hex. This is a good universal place to open a file like this as you'll be able to copy/paste plus have all of the wonderful tools of vim at your fingertips!

link|improve this answer
feedback

Identify is also useful for images:

Identify describes the format and characteristics of one or more image files. It will also report if an image is incomplete or corrupt. The information displayed includes the scene number, the file name, the width and height of the image, whether the image is colormapped or not, the number of colors in the image, the number of bytes in the image, the format of the image (JPEG, PNM, etc.), and finally the number of seconds it took to read and process the image.

link|improve this answer
feedback

Another program is bvi if you are familiar with vi.

link|improve this answer
feedback

I generally use od -bc {filename} | head to look at the header of a binary file. view works too, but I find that it is generally better to see the output directly on the terminal.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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