file常见格式识别情况汇总

251 阅读1分钟

简介

[kira@localhost ~]$ file --version
file-5.11

天翼云盘,常见格式文件收集 访问码:xy8o

结果汇总

类型格式支持情况
图像icon支持
图像jpg支持
图像ico支持
图像jpeg支持
图像png支持
图像gif支持
图像psd支持
图像bmp不支持
图像heif支持
视频aac支持
视频asf支持
视频mov支持
视频mp4支持
视频rm支持d
视频rmvb支持
视频wmv支持
音频mp3支持
音频wav支持
办公pptx支持
办公docx支持
办公doc支持
办公pdf支持
办公ppt支持
办公wps支持
办公xls支持
办公xlsx支持
办公txt支持
压缩包7z支持
压缩包tar支持
压缩包zip支持
压缩包rar支持
可执行程序exe支持
可执行程序msi支持
可执行程序linux elf支持

帮助

百度文库 常见文件格式 convertio 格式转换

批量测试改后缀脚本

#!/bin/bash

if [ ! $1 ]; then
	echo "errro, input args less"
	echo "input --less, remove file formate"
	echo "input --more, add file format"
	echo "input --test, test file file"
	exit -1
fi

if [ "$1" = "--less" ]
then
	echo ">>>>>>> arg = less <<<<<<"
	for file in `ls -I tools.sh`
	do
		if (echo ${file} | grep -q "\.")		# 含后缀名
		then
			format=${file##*.}
			echo "${file} -> $format"
			mv ${file} ${format}
		fi
	done

elif [ "$1" = "--more" ]
then
	echo ">>>>>>> arg = more <<<<<<"
	for file in `ls -I tools.sh`
	do
		if !(echo ${file} | grep -q "\.")		# 不含后缀名
		then
			echo "$file -> ${file}.${file}"
			mv ${file} ${file}.${file}
		fi
	done

elif [ $1 == "--test" ]
then
	for file in `ls -I tools.sh`
	do
		res=`file -b ${file}`

		if [ "$res" == "data" ]
		then
			echo ">${file}< not support, res :${res}"
		elif [ "$res" == "empty" ]
		then
			echo ">${file}< not support, res :${res}"
		fi
	done
fi