0

I have a file that contains a single text character (C). There is no line-feed character or similar in the file.

I am in Ubuntu 20.04.1.

When I use the command file --mime-type with this file the command says that the file is an application/octet-stream file, but if I use the command mimetype with this file the command says that the file is a text/plain file.

Why do these two tools that I considered more or less equivalent differ in guessing the mimetype of this particular file?

I also found that using the file command without arguments with the same file produces the output very short file (no magic). Is that the reason that the command is failing its guess?

What is the meaning of this? How this implementation is different from the implementation of the mime-type command?

In this case I would say that the command file --mime-type has a bug since I clearly see that the file is actually a text file. Why this happens?

Here is a screenshot of the relevant commands and its results:

commands and its output

Aleix Mariné
  • 110
  • 1
  • 9

0 Answers0