How can I find out a file's MIME type (Content-Type)?

前端 未结 5 460
遥遥无期
遥遥无期 2020-11-30 00:12

Is there a way to find out the MIME type (or is it called \"Content-Type\"?) of a file in a Linux bash script?

The reason I need it is because ImageShack appears to

5条回答
  •  没有蜡笔的小新
    2020-11-30 00:45

    Try the file command with -i option.

    -i option Causes the file command to output mime type strings rather than the more traditional human readable ones. Thus it may say text/plain; charset=us-ascii rather than ASCII text.

提交回复
热议问题