~$ file some_file_content_unknown
some_file_content_unknown: ASCII text
可以使用文件命令检查AWS S3对象,如下(但行不通)
~$ file s3://bucketa/prefixb/some_file_content_unknown
您需要先下载对象,运行
file
file
下载文件。 您可以使用AWS命令行界面来结合两个操作:
aws s3 cp s3://bucketa/prefixb/some_file_content_unknown - | file
连字符说“输出到stdout”,因此它有效地下载对象然后对其运行。