Linux file -i command outputs octet/stream for every media file

command-line-interfacefilesmimeunix

On Linux / Unix Command file:

" -i Causes the file command to output mime type strings rather than the more traditional human readable ones "

Why does it always output "application/octet-stream" for images and videos?
How can I obtain the specific mime type of an image or a video with this command or with any other command?

Thanks.

Best Answer

Can you tell us what the output is with out the -i switch?

Also, what is the output of the file --version, maybe you are missing magic files?

file --version
file-4.26
magic file from /etc/magic:/usr/share/file/magic

You might just need to update your magic package (I love how these sentances sound :-) ). Do so on debian / ubuntu :

apt-get install libmagic1