博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mime类型文件_从命令行获取文件MIME类型
阅读量:2514 次
发布时间:2019-05-11

本文共 934 字,大约阅读时间需要 3 分钟。

mime类型文件

I've gotten skilled at shell scripting over the years. I love a good GUI but knowing how to automate makes you a much more powerful engineer. Much of my scripting requires recursing over directories and processing a file if it meets a given criteria, which is often file extension or MIME type.

这些年来,我已经精通Shell脚本。 我喜欢一个好的GUI,但是知道如何自动化可以使您成为功能更强大的工程师。 我的许多脚本编制工作都需要递归目录并在文件满足给定条件(通常是文件扩展名或MIME类型)时处理文件。

You can use the following shell command to get a file's MIME type:

您可以使用以下shell命令来获取文件的MIME类型:

file --mime-type -b Downloads/main.js# text/plainfile --mime-type -b Downloads/logo.jpg# image/jpeg

It's important to use the brief (-b) option in the command or you may receive an error message.

在命令中使用简短( -b )选项很重要,否则您可能会收到错误消息。

MIME type is used for validation and any number of other informational use cases. Luckily the file command and and a flag is all you need!

MIME类型用于验证以及任何其他参考性用例。 幸运的是, file命令和标记是您所需要的!

翻译自:

mime类型文件

转载地址:http://fkvwd.baihongyu.com/

你可能感兴趣的文章
MYSQL GTID使用运维介绍(转)
查看>>
Fail to start neutron-server
查看>>
景安快运挂在磁盘-支持宝塔
查看>>
word中交叉引用不能更新的解决方法
查看>>
高性能HTTP加速器Varnish(概念篇)
查看>>
Linux 如何写makefile文件
查看>>
flutter_webview_plugin 无法加载网页的异常处理
查看>>
bloc控制读写文件
查看>>
微信小程序
查看>>
洛谷 P1059 明明的随机数
查看>>
window自动任务实现数据库定时备份
查看>>
Windows 7 Ultimate(旗舰版)SP1 32/64位官方原版下载(2011年5月12日更新版)
查看>>
javascript操作cookie
查看>>
深入理解HTTP协议(转)
查看>>
NHibernate讲解
查看>>
客户端—表单验证信息—并能否提交到数据库
查看>>
Android开发环境搭建(原创)
查看>>
java IO流 对文件操作的代码集合
查看>>
js / jquery 获取和设置 FCK Editor 的值
查看>>
sql-leetcode Consecutive Numbers
查看>>